Package org.apache.hadoop.ozone.container.common.report


package org.apache.hadoop.ozone.container.common.report
Datanode Reports: As part of heartbeat, datanode has to share its current state with SCM. The state of datanode is split into multiple reports which are sent along with heartbeat in a configured frequency.

This package contains code which is responsible for sending reports from datanode to SCM.

ReportPublisherFactory: Given a report this constructs corresponding ReportPublisher.

ReportManager: Manages and initializes all the available ReportPublishers.

ReportPublisher: Abstract class responsible for scheduling the reports based on the configured interval. All the ReportPublishers should extend ReportPublisher How to add new report:

  1. Create a new ReportPublisher class which extends ReportPublisher.
  2. Add a mapping Report to ReportPublisher entry in ReportPublisherFactory.
  3. In DatanodeStateMachine add the report to ReportManager instance.

Datanode Reports State Diagram:

   DatanodeStateMachine  ReportManager  ReportPublisher           SCM
            |                  |              |                    |
            |                  |              |                    |
            |    construct     |              |                    |
            |----------------->|              |                    |
            |                  |              |                    |
            |     init         |              |                    |
            |----------------->|              |                    |
            |                  |     init     |                    |
            |                  |------------->|                    |
            |                  |              |                    |
   +--------+------------------+--------------+--------------------+------+
   |loop    |                  |              |                    |      |
   |        |                  |   publish    |                    |      |
   |        |<-----------------+--------------|                    |      |
   |        |                  |   report     |                    |      |
   |        |                  |              |                    |      |
   |        |                  |              |                    |      |
   |        |   heartbeat(rpc) |              |                    |      |
   |        |------------------+--------------+------------------->|      |
   |        |                  |              |                    |      |
   |        |                  |              |                    |      |
   +--------+------------------+--------------+--------------------+------+
            |                  |              |                    |
            |                  |              |                    |
            |                  |              |                    |
            |     shutdown     |              |                    |
            |----------------->|              |                    |
            |                  |              |                    |
            |                  |              |                    |
            -                  -              -                    -