Class ReportPublisher<T extends com.google.protobuf.Message>

java.lang.Object
org.apache.hadoop.ozone.container.common.report.ReportPublisher<T>
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CommandStatusReportPublisher, ContainerReportPublisher, NodeReportPublisher, PipelineReportPublisher

public abstract class ReportPublisher<T extends com.google.protobuf.Message> extends Object implements Runnable
Abstract class responsible for scheduling the reports based on the configured interval. All the ReportPublishers should extend this class.
  • Constructor Details

    • ReportPublisher

      public ReportPublisher()
  • Method Details

    • init

      public void init(StateContext stateContext, ScheduledExecutorService executorService)
      Initializes ReportPublisher with stateContext and executorService.
      Parameters:
      stateContext - Datanode state context
      executorService - ScheduledExecutorService to schedule reports
    • setConf

      public void setConf(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
    • getConf

      public org.apache.hadoop.hdds.conf.ConfigurationSource getConf()
    • run

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

      protected abstract long getReportFrequency()
      Returns the frequency in which this particular report has to be scheduled.
      Returns:
      report interval in milliseconds
    • getReport

      protected abstract T getReport() throws IOException
      Generate and returns the report which has to be sent as part of heartbeat.
      Returns:
      datanode report
      Throws:
      IOException
    • getContext

      protected StateContext getContext()
      Returns StateContext.
      Returns:
      stateContext report