Class PluggableAlarmUtil


  • public class PluggableAlarmUtil
    extends java.lang.Object
    Pluggable alarms util. Used to get a list of pluggable alarms from CLDB
    • 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 map
      static com.mapr.fs.proto.Common.PluggableAlarm getAlarmByName​(com.mapr.fs.proto.Security.CredentialsMsg creds, java.lang.String alarmName)  
      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
      static 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 CLDB
      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)  
      static int getMaxNumNodes​(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 void resetCache()
      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 Detail

      • PluggableAlarmUtil

        public PluggableAlarmUtil()
    • 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.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 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.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 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.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 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)