ChenSammi commented on a change in pull request #2360:
URL: https://github.com/apache/ozone/pull/2360#discussion_r685034118
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java
##########
@@ -155,17 +156,30 @@ public DatanodeStateMachine(DatanodeDetails
datanodeDetails,
dnCertClient = certClient;
nextHB = new AtomicLong(Time.monotonicNow());
+ SslContext sslContext = null;
+ SecurityConfig securityConfig = new SecurityConfig(conf);
+ if (securityConfig.isSecurityEnabled()) {
+
+ sslContext = SslContextBuilder.forClient()
+ .trustManager(certClient.getCACertificate())
+ .clientAuth(ClientAuth.REQUIRE)
+ .keyManager(certClient.getPrivateKey(), certClient.getCertificate())
+ .build();
+
+ }
+
ContainerReplicator replicator =
- new DownloadAndImportReplicator(container.getContainerSet(),
- container.getController(),
- new SimpleContainerDownloader(conf, dnCertClient),
- new TarContainerPacker());
+ new DownloadAndImportReplicator(conf,
+ container::getClusterId,
+ container.getContainerSet(),
+ container.getVolumeSet(),
+ sslContext);
replicatorMetrics = new MeasuredReplicator(replicator);
supervisor =
- new ReplicationSupervisor(container.getContainerSet(), context,
- replicatorMetrics, dnConf.getReplicationMaxStreams());
+ new ReplicationSupervisor(container.getContainerSet(), replicator,
+ dnConf.getReplicationMaxStreams());
Review comment:
Will this lead to replicatorMetrics never be used?
--
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]