ChenSammi commented on a change in pull request #1992:
URL: https://github.com/apache/ozone/pull/1992#discussion_r601012360
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeCreateRequest.java
##########
@@ -117,21 +116,17 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
boolean acquiredUserLock = false;
IOException exception = null;
OMClientResponse omClientResponse = null;
- OmVolumeArgs omVolumeArgs = null;
- Map<String, String> auditMap = new HashMap<>();
- try {
- omVolumeArgs = OmVolumeArgs.getFromProtobuf(volumeInfo);
- // when you create a volume, we set both Object ID and update ID.
- // The Object ID will never change, but update
- // ID will be set to transactionID each time we update the object.
- omVolumeArgs.setObjectID(
- ozoneManager.getObjectIdFromTxId(transactionLogIndex));
- omVolumeArgs.setUpdateID(transactionLogIndex,
- ozoneManager.isRatisEnabled());
-
-
- auditMap = omVolumeArgs.toAuditMap();
+ OmVolumeArgs omVolumeArgs = OmVolumeArgs.getFromProtobuf(volumeInfo);
Review comment:
getFromProtobuf has the chance to throw exceptions, so shall we keep
into the try scope?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]