Package com.mapr.cli.common
Class PluggableAlarmUtil
- java.lang.Object
-
- com.mapr.cli.common.PluggableAlarmUtil
-
public class PluggableAlarmUtil extends java.lang.ObjectPluggable alarms util. Used to get a list of pluggable alarms from CLDB
-
-
Constructor Summary
Constructors Constructor Description PluggableAlarmUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<NodeField,com.mapr.cliframework.util.FieldInfo>appendNodeMap(com.mapr.fs.proto.Security.CredentialsMsg creds, com.google.common.collect.ImmutableMap.Builder<NodeField,com.mapr.cliframework.util.FieldInfo> table)static java.util.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, java.lang.String alarmName)static com.mapr.fs.proto.Common.AlarmIdgetAlarmId(java.lang.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 java.util.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 java.util.List<com.mapr.fs.proto.Common.PluggableAlarm>getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, java.lang.String alarmName)Method that calls getAlarms with the given values.static java.util.List<com.mapr.fs.proto.Common.PluggableAlarm>getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, java.lang.String alarmName, int start, int limit)Method to get all the pluggable alarms from the CLDBstatic java.util.List<com.mapr.fs.proto.Common.PluggableAlarm>getAlarmsByType(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end, java.lang.String type)static intgetMaxNumNodes(com.mapr.fs.proto.Security.CredentialsMsg creds, int currentMax)static java.util.List<com.mapr.fs.proto.Common.PluggableAlarm>getNodeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end)static java.util.List<com.mapr.fs.proto.Common.PluggableAlarm>getVolumeAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end)static voidresetCache()Method used to reset pluggableAlarms cache.
-
-
-
Method Detail
-
getAlarms
public static java.util.List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, java.lang.String alarmName, int start, int limit) throws com.mapr.cliframework.base.CLIProcessingExceptionMethod 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 java.util.List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end) throws com.mapr.cliframework.base.CLIProcessingExceptionMethod 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 java.util.List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarmsByType(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end, java.lang.String type) throws com.mapr.cliframework.base.CLIProcessingException- Throws:
com.mapr.cliframework.base.CLIProcessingException
-
getVolumeAlarms
public static java.util.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 java.util.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 java.util.List<com.mapr.fs.proto.Common.PluggableAlarm> getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, java.lang.String alarmName) throws com.mapr.cliframework.base.CLIProcessingExceptionMethod 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 java.util.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
public static java.util.Map<NodeField,com.mapr.cliframework.util.FieldInfo> appendNodeMap(com.mapr.fs.proto.Security.CredentialsMsg creds, com.google.common.collect.ImmutableMap.Builder<NodeField,com.mapr.cliframework.util.FieldInfo> table)
-
getAlarmId
public static com.mapr.fs.proto.Common.AlarmId getAlarmId(java.lang.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 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, java.lang.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)
-
-