Class ECContainerOperationClient
java.lang.Object
org.apache.hadoop.ozone.container.ec.reconstruction.ECContainerOperationClient
- All Implemented Interfaces:
Closeable,AutoCloseable
This class wraps necessary container-level rpc calls
during ec offline reconstruction.
- ListBlock
- CloseContainer
-
Constructor Summary
ConstructorsConstructorDescriptionECContainerOperationClient(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 TypeMethodDescriptionvoidclose()voidcloseContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken) voidcreateRecoveringContainer(long containerID, org.apache.hadoop.hdds.protocol.DatanodeDetails dn, org.apache.hadoop.hdds.client.ECReplicationConfig repConfig, String encodedToken, int replicaIndex) voiddeleteContainerInState(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.XceiverClientManagerorg.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)
-
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
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-