jojochuang commented on code in PR #7456:
URL: https://github.com/apache/ozone/pull/7456#discussion_r1915728147
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientCreator.java:
##########
@@ -56,20 +60,36 @@ public XceiverClientCreator(ConfigurationSource conf,
ClientTrustManager trustMa
if (securityEnabled) {
Preconditions.checkNotNull(trustManager);
}
+ shortCircuitEnabled =
conf.getObject(OzoneClientConfig.class).isShortCircuitEnabled();
+ if (shortCircuitEnabled) {
+ domainSocketFactory = DomainSocketFactory.getInstance(conf);
+ }
}
public boolean isSecurityEnabled() {
return securityEnabled;
}
+ public boolean isShortCircuitEnabled() {
+ return shortCircuitEnabled && domainSocketFactory.isServiceReady();
+ }
+
protected XceiverClientSpi newClient(Pipeline pipeline) throws IOException {
+ return newClient(pipeline, null);
+ }
+
+ protected XceiverClientSpi newClient(Pipeline pipeline, DatanodeDetails dn)
throws IOException {
XceiverClientSpi client;
switch (pipeline.getType()) {
case RATIS:
client = XceiverClientRatis.newXceiverClientRatis(pipeline, conf,
trustManager, errorInjector);
break;
case STAND_ALONE:
- client = new XceiverClientGrpc(pipeline, conf, trustManager);
+ if (dn != null) {
+ client = new XceiverClientShortCircuit(pipeline, conf, dn);
Review Comment:
I'm wondering what happens if the local replica is unavailable
(corrupt/missing/DN crash). Does it retry with a remote replica? Is there a
test for this scenario?
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java:
##########
@@ -567,6 +673,10 @@ synchronized long getBlockPosition() {
return blockPosition;
}
+ public synchronized FileInputStream getBlockInputStream() {
Review Comment:
This method doesn't need to be synchronized. Just declare blockInputStream
volatile.
--
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]