Class ECContainerOperationClient

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

public class ECContainerOperationClient extends Object implements Closeable
This class wraps necessary container-level rpc calls during ec offline reconstruction. - ListBlock - CloseContainer
  • Constructor Summary

    Constructors
    Constructor
    Description
    ECContainerOperationClient(org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient certificateClient)
     
    ECContainerOperationClient(org.apache.hadoop.hdds.scm.XceiverClientManager clientManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    closeContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken)
     
    void
    createRecoveringContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken, int replicaIndex)
     
    void
    deleteContainerInState(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken, Set<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerDataProto.State> acceptableStates)
    Deletes the container at the given DN.
    org.apache.hadoop.hdds.scm.XceiverClientManager
     
    org.apache.hadoop.ozone.container.common.helpers.BlockData[]
    listBlock(long containerId, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ECContainerOperationClient

      public ECContainerOperationClient(org.apache.hadoop.hdds.scm.XceiverClientManager clientManager)
    • ECContainerOperationClient

      public ECContainerOperationClient(org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient certificateClient) throws IOException
      Throws:
      IOException
  • Method Details

    • listBlock

      public org.apache.hadoop.ozone.container.common.helpers.BlockData[] listBlock(long containerId, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token) throws IOException
      Throws:
      IOException
    • closeContainer

      public void closeContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken) throws IOException
      Throws:
      IOException
    • deleteContainerInState

      public void deleteContainerInState(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken, Set<org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerDataProto.State> acceptableStates) throws IOException
      Deletes the container at the given DN. Before deleting it will pre-check whether the container is in RECOVERING state. As this is not an atomic check for RECOVERING container, there is a chance non recovering containers could get deleted if they just created in the window time of RECOVERING container exist check and delete op. So, user of the API needs to keep this scenario in mind and use this API if it is still safe. TODO: Alternatively we can extend this API to pass the flag to perform the check at server side. So, that it will become atomic op.
      Parameters:
      containerID - - Container ID.
      dn - - Datanode details.
      repConfig - - Replication config.
      encodedToken - - Token
      Throws:
      IOException
    • createRecoveringContainer

      public void createRecoveringContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken, int replicaIndex) throws IOException
      Throws:
      IOException
    • getXceiverClientManager

      public org.apache.hadoop.hdds.scm.XceiverClientManager getXceiverClientManager()
    • close

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