bharatviswa504 commented on a change in pull request #448: HDDS-2870. Handle
replay of KeyCreate requests.
URL: https://github.com/apache/hadoop-ozone/pull/448#discussion_r372024424
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
##########
@@ -254,36 +294,88 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
OmBucketInfo bucketInfo = omMetadataManager.getBucketTable().get(
omMetadataManager.getBucketKey(volumeName, bucketName));
encryptionInfo = getFileEncryptionInfo(ozoneManager, bucketInfo);
- omKeyInfo = prepareKeyInfo(omMetadataManager, keyArgs,
- omMetadataManager.getOzoneKey(volumeName, bucketName,
- keyName), keyArgs.getDataSize(), locations,
- encryptionInfo.orNull(), ozoneManager.getPrefixManager(),
- bucketInfo, transactionLogIndex);
-
- omClientResponse = prepareCreateKeyResponse(keyArgs, omKeyInfo,
- locations, encryptionInfo.orNull(), exception,
- createFileRequest.getClientID(), transactionLogIndex, volumeName,
- bucketName, keyName, ozoneManager,
- OMAction.CREATE_FILE, ozoneManager.getPrefixManager(), bucketInfo);
+
+ omKeyInfo = prepareKeyInfo(omMetadataManager, keyArgs, dbKeyInfo,
+ keyArgs.getDataSize(), locations, encryptionInfo.orNull(),
+ ozoneManager.getPrefixManager(), bucketInfo, trxnLogIndex);
+
+ long openVersion = omKeyInfo.getLatestVersionLocations().getVersion();
Review comment:
L302-L318 is common for FileCreate and KeyCreate can we move into a method
and use it.
Or we can move these to prepareKeyInfo from 302-310 and add new method to
add to cache and response. In this way OmKeyInfo will be generated by
prepareKeyInfo and response and adding to cache will be in a new method.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]