Class ElasticAlarmIndexer

    • Constructor Detail

      • ElasticAlarmIndexer

        public ElasticAlarmIndexer​(com.codahale.metrics.MetricRegistry metrics,
                                   io.searchbox.client.JestClient client,
                                   TemplateInitializer templateInitializer)
      • ElasticAlarmIndexer

        public ElasticAlarmIndexer​(com.codahale.metrics.MetricRegistry metrics,
                                   io.searchbox.client.JestClient client,
                                   TemplateInitializer templateInitializer,
                                   CacheConfig nodeCacheConfig,
                                   int taskQueueCapacity,
                                   IndexStrategy indexStrategy,
                                   IndexSettings indexSettings)
    • Method Detail

      • init

        public void init()
      • destroy

        public void destroy()
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • handleAlarmSnapshot

        public void handleAlarmSnapshot​(List<OnmsAlarm> alarms)
        Description copied from interface: AlarmLifecycleListener
        Called periodically with a complete set of alarms as present in the database at the given timestamp. This should be used to synchronize any state to ensure it matches what is currently in the database. Note that it is possible that the *current* state of alarms is different from the state at the time at which the snapshot was taken. Implementations should take this in consideration when performing any state synchronization. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleAlarmSnapshot in interface AlarmLifecycleListener
        Parameters:
        alarms - canonical set of alarms in the database
      • handleNewOrUpdatedAlarm

        public void handleNewOrUpdatedAlarm​(OnmsAlarm alarm)
        Description copied from interface: AlarmLifecycleListener
        Called when an alarm has been created or updated. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleNewOrUpdatedAlarm in interface AlarmLifecycleListener
        Parameters:
        alarm - a newly created or updated alarm
      • handleDeletedAlarm

        public void handleDeletedAlarm​(int alarmId,
                                       String reductionKey)
        Description copied from interface: AlarmLifecycleListener
        Called when an alarm has been deleted. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleDeletedAlarm in interface AlarmLifecycleListener
        Parameters:
        alarmId - id of the alarm that was deleted
        reductionKey - reduction key of the alarm that was deleted
      • setBulkRetryCount

        public void setBulkRetryCount​(int bulkRetryCount)
      • setBatchSize

        public void setBatchSize​(int batchSize)
      • setAlarmReindexDurationMs

        public void setAlarmReindexDurationMs​(long alarmReindexDurationMs)
      • setLookbackPeriodMs

        public void setLookbackPeriodMs​(long lookbackPeriodMs)
      • setUsePseudoClock

        public void setUsePseudoClock​(boolean usePseudoClock)
      • setIndexAllUpdates

        public void setIndexAllUpdates​(boolean indexAllUpdates)