Class SimpleContainerDownloader
java.lang.Object
org.apache.hadoop.ozone.container.replication.SimpleContainerDownloader
- All Implemented Interfaces:
Closeable,AutoCloseable,ContainerDownloader
Simple ContainerDownloaderImplementation to download the missing container
from the first available datanode.
This is not the most effective implementation as it uses only one source for he container download.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleContainerDownloader(org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient certClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected GrpcReplicationClientcreateReplicationClient(org.apache.hadoop.hdds.protocol.DatanodeDetails datanode, CopyContainerCompression compression) protected CompletableFuture<Path> downloadContainer(GrpcReplicationClient client, long containerId, Path downloadDir) getContainerDataFromReplicas(long containerId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> sourceDatanodes, Path downloadDir, CopyContainerCompression compression) protected List<org.apache.hadoop.hdds.protocol.DatanodeDetails> shuffleDatanodes(List<org.apache.hadoop.hdds.protocol.DatanodeDetails> sourceDatanodes)
-
Constructor Details
-
SimpleContainerDownloader
public SimpleContainerDownloader(org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient certClient)
-
-
Method Details
-
getContainerDataFromReplicas
public Path getContainerDataFromReplicas(long containerId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> sourceDatanodes, Path downloadDir, CopyContainerCompression compression) - Specified by:
getContainerDataFromReplicasin interfaceContainerDownloader
-
shuffleDatanodes
-
createReplicationClient
protected GrpcReplicationClient createReplicationClient(org.apache.hadoop.hdds.protocol.DatanodeDetails datanode, CopyContainerCompression compression) throws IOException - Throws:
IOException
-
downloadContainer
protected CompletableFuture<Path> downloadContainer(GrpcReplicationClient client, long containerId, Path downloadDir) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-