ChenSammi commented on code in PR #3648:
URL: https://github.com/apache/ozone/pull/3648#discussion_r1064258716
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java:
##########
@@ -51,38 +50,36 @@ public class SimpleContainerDownloader implements
ContainerDownloader {
public static final Logger LOG =
LoggerFactory.getLogger(SimpleContainerDownloader.class);
- private final Path workingDirectory;
+ private ConfigurationSource conf;
private final SecurityConfig securityConfig;
private final CertificateClient certClient;
private final String compression;
- public SimpleContainerDownloader(ConfigurationSource conf,
- CertificateClient certClient) {
- String workDirString =
- conf.get(OzoneConfigKeys.OZONE_CONTAINER_COPY_WORKDIR);
-
- if (workDirString == null) {
- workingDirectory = Paths.get(System.getProperty("java.io.tmpdir"))
- .resolve("container-copy");
- } else {
- workingDirectory = Paths.get(workDirString);
- }
+ public SimpleContainerDownloader(
+ ConfigurationSource conf, CertificateClient certClient) {
+ this.conf = conf;
securityConfig = new SecurityConfig(conf);
this.certClient = certClient;
this.compression = CopyContainerCompression.getConf(conf).toString();
}
@Override
public Path getContainerDataFromReplicas(
- long containerId, List<DatanodeDetails> sourceDatanodes) {
+ long containerId, List<DatanodeDetails> sourceDatanodes,
+ Path downloadDir) {
+
+ if (downloadDir == null) {
+ downloadDir = Paths.get(System.getProperty("java.io.tmpdir"))
+ .resolve("container-copy");
Review Comment:
We can use CONTAINER_COPY_DIR here to replace the string "container-copy".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]