Class PluggableAlarmUtil

java.lang.Object
com.mapr.cli.common.PluggableAlarmUtil

public class PluggableAlarmUtil extends Object
Pluggable alarms util. Used to get a list of pluggable alarms from CLDB
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 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
    static com.mapr.fs.proto.Common.PluggableAlarm
    getAlarmByName(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName)
     
    static com.mapr.fs.proto.Common.AlarmId
    getAlarmId(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
    static 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>
    getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName)
    Method that calls getAlarms with the given values.
    static List<com.mapr.fs.proto.Common.PluggableAlarm>
    getAlarms(com.mapr.fs.proto.Security.CredentialsMsg creds, String alarmName, int start, int limit)
    Method to get all the pluggable alarms from the CLDB
    static List<com.mapr.fs.proto.Common.PluggableAlarm>
    getAlarmsByType(com.mapr.fs.proto.Security.CredentialsMsg creds, int start, int end, String type)
     
    static int
    getMaxNumNodes(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 void
    Method used to reset pluggableAlarms cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 use
      alarmName - The alarmName to get specifically. If null, then gets them all
      start - The first record to start at. Default should be 0
      limit - 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 use
      start - The first record to start at. Default should be 0
      end - 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 use
      alarmName - 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

      public static 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(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, 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)