hanishakoneru commented on a change in pull request #884: HDDS-1620. Implement
Volume Write Requests to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/884#discussion_r292260697
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/volume/OMVolumeCreateResponse.java
##########
@@ -47,15 +49,19 @@ public OMVolumeCreateResponse(OmVolumeArgs omVolumeArgs,
public void addToDBBatch(OMMetadataManager omMetadataManager,
BatchOperation batchOperation) throws IOException {
- String dbVolumeKey =
- omMetadataManager.getVolumeKey(omVolumeArgs.getVolume());
- String dbUserKey =
- omMetadataManager.getUserKey(omVolumeArgs.getOwnerName());
+ // For OmResponse with failure, this should do nothing. This method is
+ // not called in failure scenario in OM code.
+ if (getOMResponse().getStatus() == OzoneManagerProtocolProtos.Status.OK) {
+ String dbVolumeKey =
+ omMetadataManager.getVolumeKey(omVolumeArgs.getVolume());
+ String dbUserKey =
+ omMetadataManager.getUserKey(omVolumeArgs.getOwnerName());
- omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
dbVolumeKey,
- omVolumeArgs);
- omMetadataManager.getUserTable().putWithBatch(batchOperation, dbUserKey,
- volumeList);
+ omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+ dbVolumeKey, omVolumeArgs);
+ omMetadataManager.getUserTable().putWithBatch(batchOperation, dbUserKey,
+ volumeList);
+ }
}
public VolumeList getVolumeList() {
Review comment:
This method is not used anywhere.
----------------------------------------------------------------
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]