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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hdds.conf.ConfigurationSourcegetConf()protected StateContextReturnsStateContext.protected abstract TGenerate and returns the report which has to be sent as part of heartbeat.protected abstract longReturns the frequency in which this particular report has to be scheduled.voidinit(StateContext stateContext, ScheduledExecutorService executorService) Initializes ReportPublisher with stateContext and executorService.voidrun()voidsetConf(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
-
Constructor Details
-
ReportPublisher
public ReportPublisher()
-
-
Method Details
-
init
Initializes ReportPublisher with stateContext and executorService.- Parameters:
stateContext- Datanode state contextexecutorService- 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() -
getReportFrequency
protected abstract long getReportFrequency()Returns the frequency in which this particular report has to be scheduled.- Returns:
- report interval in milliseconds
-
getReport
Generate and returns the report which has to be sent as part of heartbeat.- Returns:
- datanode report
- Throws:
IOException
-
getContext
ReturnsStateContext.- Returns:
- stateContext report
-