jojochuang commented on code in PR #6014:
URL: https://github.com/apache/ozone/pull/6014#discussion_r1619255249
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientGrpc.java:
##########
@@ -506,6 +507,13 @@ public XceiverClientReply sendCommandAsync(
}
}
+ @Override
+ public XceiverClientReply sendCommandAsync(
+ ContainerCommandRequestProto request, ReplicationLevel
writeReplicationLevel) {
+ // TODO: Is throwing NotImplementedException better?
Review Comment:
i'm fine with IllegalArgumentException
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java:
##########
@@ -470,7 +472,8 @@ public static XceiverClientReply writeChunkAsync(
builder.setEncodedToken(tokenString);
}
ContainerCommandRequestProto request = builder.build();
- return xceiverClient.sendCommandAsync(request);
+// return xceiverClient.sendCommandAsync(request,
ReplicationLevel.MAJORITY_COMMITTED);
+ return xceiverClient.sendCommandAsync(request,
ReplicationLevel.ALL_COMMITTED);
Review Comment:
if WriteChunk is MAJORITY_COMMITTED or ALL_COMMITTED, does it mean
waitOnFlushFutures is no longer needed too?
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java:
##########
@@ -217,29 +217,46 @@ public ConcurrentMap<UUID, Long> getCommitInfoMap() {
return commitInfoMap;
}
+ private CompletableFuture<RaftClientReply> sendRequestAsyncInternal(
+ ContainerCommandRequestProto request, ReplicationLevel
writeReplicationLevel) {
+ final ContainerCommandRequestMessage message =
+ ContainerCommandRequestMessage.toMessage(request,
TracingUtil.exportCurrentSpan());
+ if (HddsUtils.isReadOnly(request)) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("sendCommandAsync ReadOnly {}", message);
+ }
+ return getClient().async().sendReadOnly(message);
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("sendCommandAsync write {} {}", writeReplicationLevel,
message);
+ }
Review Comment:
```suggestion
LOG.debug("sendCommandAsync write {} {}", writeReplicationLevel,
message);
```
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java:
##########
@@ -217,29 +217,46 @@ public ConcurrentMap<UUID, Long> getCommitInfoMap() {
return commitInfoMap;
}
+ private CompletableFuture<RaftClientReply> sendRequestAsyncInternal(
+ ContainerCommandRequestProto request, ReplicationLevel
writeReplicationLevel) {
+ final ContainerCommandRequestMessage message =
+ ContainerCommandRequestMessage.toMessage(request,
TracingUtil.exportCurrentSpan());
+ if (HddsUtils.isReadOnly(request)) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("sendCommandAsync ReadOnly {}", message);
+ }
Review Comment:
```suggestion
LOG.debug("sendCommandAsync ReadOnly {}", message);
```
--
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]