Package com.mapr.cli.common
Class PluggableAlarmUtil
java.lang.Object
com.mapr.cli.common.PluggableAlarmUtil
Pluggable alarms util. Used to get a list of pluggable alarms from CLDB
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendNodeMap(com.mapr.fs.proto.Security.CredentialsMsg creds, com.google.common.collect.ImmutableMap.Builder<NodeField, com.mapr.cliframework.util.FieldInfo> table) static Map<VolumeField,com.mapr.cliframework.util.FieldInfo> appendVolumeMap(com.mapr.fs.proto.Security.CredentialsMsg creds, com.google.common.collect.ImmutableMap.Builder<VolumeField, com.mapr.cliframework.util.FieldInfo> table) Map volume type alarms to the volume immutable mapstatic com.mapr.fs.proto.Common.PluggableAlarmgetAlarmByName(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName) static com.mapr.fs.proto.Common.AlarmIdgetAlarmId(String alarmName) NOTE: This method is in com.mapr.fs.cldb.alarms.PluggableAlarms as well Static method to get the AlarmId object from a given alarm stringstatic List<com.mapr.fs.proto.Common.PluggableAlarm>getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) Method that calls getAlarms with the given values.static List<com.mapr.fs.proto.Common.PluggableAlarm>Method that calls getAlarms with the given values.static List<com.mapr.fs.proto.Common.PluggableAlarm>Method to get all the pluggable alarms from the CLDBstatic List<com.mapr.fs.proto.Common.PluggableAlarm>getAlarmsByType(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end, String type) static intgetMaxNumNodes(com.mapr.fs.proto.Security.CredentialsMsg creds, int currentMax) static List<com.mapr.fs.proto.Common.PluggableAlarm>getNodeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) static List<com.mapr.fs.proto.Common.PluggableAlarm>getVolumeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) static voidMethod used to reset pluggableAlarms cache.
-
Constructor Details
-
PluggableAlarmUtil
public PluggableAlarmUtil()
-
-
Method Details
-
getAlarms
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName, int start, int limit) throws com.mapr.cliframework.base.CLIProcessingException Method to get all the pluggable alarms from the CLDB- Parameters:
creds- The user credentials to usealarmName- The alarmName to get specifically. If null, then gets them allstart- The first record to start at. Default should be 0limit- The last record. Default should be 50. Uses NUM_ALARMS_PER_RPC if greater than it's value- Returns:
- The List of all PluggableAlarms retrieved
- Throws:
com.mapr.cliframework.base.CLIProcessingException- Throws exception on any error, such as connecting to CLDB.
-
getAlarms
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) throws com.mapr.cliframework.base.CLIProcessingException Method that calls getAlarms with the given values. Will call getAlarms with null alarmName- Parameters:
creds- User credentials to usestart- The first record to start at. Default should be 0end- The last record. Default should be 50. Uses NUM_ALARMS_PER_RPC if greater than it's value- Returns:
- The List of all PluggableAlarms retrieved
- Throws:
com.mapr.cliframework.base.CLIProcessingException- Throws exception on any error, such as connecting to CLDB.
-
getAlarmsByType
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarmsByType(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end, String type) throws com.mapr.cliframework.base.CLIProcessingException - Throws:
com.mapr.cliframework.base.CLIProcessingException
-
getVolumeAlarms
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getVolumeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) throws com.mapr.cliframework.base.CLIProcessingException - Throws:
com.mapr.cliframework.base.CLIProcessingException
-
getNodeAlarms
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getNodeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) throws com.mapr.cliframework.base.CLIProcessingException - Throws:
com.mapr.cliframework.base.CLIProcessingException
-
getAlarms
public static List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName) throws com.mapr.cliframework.base.CLIProcessingException Method that calls getAlarms with the given values. Will call getAlarms with 0 start and 1 limit- Parameters:
creds- User credentials to usealarmName- The alarmName to get specifically. If null, then gets them all- Returns:
- The List of all PluggableAlarms retrieved
- Throws:
com.mapr.cliframework.base.CLIProcessingException- Throws exception on any error, such as connecting to CLDB.
-
appendVolumeMap
public static Map<VolumeField,com.mapr.cliframework.util.FieldInfo> appendVolumeMap(com.mapr.fs.proto.Security.CredentialsMsg creds, com.google.common.collect.ImmutableMap.Builder<VolumeField, com.mapr.cliframework.util.FieldInfo> table) Map volume type alarms to the volume immutable map- Parameters:
creds-table-- Returns:
-
appendNodeMap
-
getAlarmId
NOTE: This method is in com.mapr.fs.cldb.alarms.PluggableAlarms as well Static method to get the AlarmId object from a given alarm string- Parameters:
alarmName- The alarm name to look up in AlarmId enum object- Returns:
- The AlarmId associated with the given string. Null if not found (for pluggable alarms)
-
getAlarmByName
public static com.mapr.fs.proto.Common.PluggableAlarm getAlarmByName(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName) -
getMaxNumNodes
public static int getMaxNumNodes(com.mapr.fs.proto.Security.CredentialsMsg creds, int currentMax) -
resetCache
public static void resetCache()Method used to reset pluggableAlarms cache. It will be called by maprcli alarm view (used to restart webserver cache, since maprcli is held in memory by webserver process)
-