class IncrementalContainerReportHandler extends
    AbstractContainerReportHandler implements EventHandler<IncrementalContainerReportFromDatanode> {

  @Override
  public void onMessage(final IncrementalContainerReportFromDatanode report,
                        final EventPublisher publisher) {
    final DatanodeDetails dnFromReport = report.getDatanodeDetails();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Processing incremental container report from data node {}",
          dnFromReport.getUuid());
    }
    DatanodeDetails dd =
        nodeManager.getNodeByUuid(dnFromReport.getUuidString());
    if (dd == null) {
      LOG.warn("Received container report from unknown datanode {}",
          dnFromReport);
      return;
    }

    boolean success = true;
    for (ContainerReplicaProto replicaProto :
        report.getReport().getReportList()) {
      try {
        final ContainerID id = ContainerID.valueof(
            replicaProto.getContainerID());
        if (!replicaProto.getState().equals(
            ContainerReplicaProto.State.DELETED)) {
          nodeManager.addContainer(dd, id);
        }
        processContainerReplica(dd, replicaProto, publisher);
      } catch (ContainerNotFoundException e) {
        success = false;
        LOG.warn("Container {} not found!", replicaProto.getContainerID());
      } catch (NodeNotFoundException ex) {
        success = false;
        LOG.error("Received ICR from unknown datanode {}",
            report.getDatanodeDetails(), ex);
      } catch (IOException e) {
        success = false;
        LOG.error("Exception while processing ICR for container {}",
            replicaProto.getContainerID(), e);
      }
    }

    getContainerManager().notifyContainerReportProcessing(false, success);
  }

  public  IncrementalContainerReportHandler(
      final NodeManager nodeManager,
      final ContainerManager containerManager);

}