Class ECReconstructionCoordinator

java.lang.Object
org.apache.hadoop.ozone.container.ec.reconstruction.ECReconstructionCoordinator
All Implemented Interfaces:
Closeable, AutoCloseable

public class ECReconstructionCoordinator extends Object implements Closeable
The Coordinator implements the main flow of reconstructing missing container replicas.

For a container reconstruction task, the main flow is: - ListBlock from all healthy replicas - calculate effective block group len for all blocks - create RECOVERING containers in TargetDNs - for each block - build a ECReconstructedStripedInputStream to read healthy chunks - build a ECBlockOutputStream to write out decoded chunks - for each stripe - use ECReconstructedStripedInputStream.recoverChunks to decode chunks - use ECBlockOutputStream.write to write decoded chunks to TargetDNs - PutBlock - Close RECOVERING containers in TargetDNs

  • Constructor Details

    • ECReconstructionCoordinator

      public ECReconstructionCoordinator(org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient certificateClient, org.apache.hadoop.hdds.security.symmetric.SecretKeySignerClient secretKeyClient, StateContext context, ECReconstructionMetrics metrics, String threadNamePrefix) throws IOException
      Throws:
      IOException
  • Method Details

    • reconstructECContainerGroup

      public void reconstructECContainerGroup(long containerID, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, SortedMap<Integer,org.apache.hadoop.hdds.protocol.DatanodeDetails> sourceNodeMap, SortedMap<Integer,org.apache.hadoop.hdds.protocol.DatanodeDetails> targetNodeMap) throws IOException
      Throws:
      IOException
    • reconstructECBlockGroup

      public void reconstructECBlockGroup(org.apache.hadoop.hdds.scm.storage.BlockLocationInfo blockLocationInfo, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, SortedMap<Integer,org.apache.hadoop.hdds.protocol.DatanodeDetails> targetMap, org.apache.hadoop.ozone.container.common.helpers.BlockData[] blockDataGroup) throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getECReconstructionMetrics

      public ECReconstructionMetrics getECReconstructionMetrics()