ashishkumar50 commented on code in PR #7166:
URL: https://github.com/apache/ozone/pull/7166#discussion_r1753155441
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2065,6 +2065,7 @@ private void addOMNodeToPeers(String newOMNodeId) throws
IOException {
} catch (IOException e) {
LOG.error("{}: Couldn't add OM {} to peer list.", getOMNodeId(),
newOMNodeId);
+ return;
Review Comment:
This is impacting refactor?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashOzoneFileSystem.java:
##########
@@ -97,34 +91,15 @@ public TrashOzoneFileSystem(OzoneManager ozoneManager)
throws IOException {
ozoneConfiguration = OzoneConfiguration.of(getConf());
}
- private RaftClientRequest getRatisRequest(
- OzoneManagerProtocolProtos.OMRequest omRequest) {
- return RaftClientRequest.newBuilder()
- .setClientId(CLIENT_ID)
- .setServerId(ozoneManager.getOmRatisServer().getRaftPeerId())
- .setGroupId(ozoneManager.getOmRatisServer().getRaftGroupId())
- .setCallId(runCount.getAndIncrement())
- .setMessage(
- Message.valueOf(
- OMRatisHelper.convertRequestToByteString(omRequest)))
- .setType(RaftClientRequest.writeRequestType())
- .build();
-
- }
-
private void submitRequest(OzoneManagerProtocolProtos.OMRequest omRequest)
throws Exception {
ozoneManager.getMetrics().incNumTrashWriteRequests();
if (ozoneManager.isRatisEnabled()) {
- OMClientRequest omClientRequest =
- OzoneManagerRatisUtils.createClientRequest(omRequest, ozoneManager);
+ // perform preExecute as ratis submit do no perform preExecute
+ OMClientRequest omClientRequest =
OzoneManagerRatisUtils.createClientRequest(omRequest, ozoneManager);
omRequest = omClientRequest.preExecute(ozoneManager);
- RaftClientRequest req = getRatisRequest(omRequest);
- ozoneManager.getOmRatisServer().submitRequest(omRequest, req);
- } else {
- ozoneManager.getOmServerProtocol().
- submitRequest(NULL_RPC_CONTROLLER, omRequest);
}
+ OzoneManagerRatisUtils.submitRequest(ozoneManager, omRequest, CLIENT_ID,
runCount.getAndIncrement());
Review Comment:
`runCount` was not incremented before in case of non-ratis case. But now it
will increment in both cases. Is it fine here?
--
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]