-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-4581. Cleanup usage of volumeArgs in KeyRequests. #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
596270a
82dd5d8
3c73b8d
3bc6d0e
73023ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,6 @@ | |
| import org.apache.hadoop.ozone.OzoneAcl; | ||
| import org.apache.hadoop.ozone.OzoneConsts; | ||
| import org.apache.hadoop.ozone.om.OMConfigKeys; | ||
| import org.apache.hadoop.ozone.om.helpers.OmVolumeArgs; | ||
| import org.apache.hadoop.ozone.om.request.util.OmResponseUtil; | ||
| import org.apache.hadoop.ozone.om.response.file.OMFileCreateResponse; | ||
| import org.slf4j.Logger; | ||
|
|
@@ -187,7 +186,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
| boolean acquiredLock = false; | ||
|
|
||
| OmKeyInfo omKeyInfo = null; | ||
| OmVolumeArgs omVolumeArgs = null; | ||
| OmBucketInfo omBucketInfo = null; | ||
| final List<OmKeyLocationInfo> locations = new ArrayList<>(); | ||
| List<OmKeyInfo> missingParentInfos; | ||
|
|
@@ -279,7 +277,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
| .collect(Collectors.toList()); | ||
| omKeyInfo.appendNewBlocks(newLocationList, false); | ||
|
|
||
| omVolumeArgs = getVolumeInfo(omMetadataManager, volumeName); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the use of the getVolumeInfo method has been removed, so getVolumeInfo should not be needed, we can delete it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| omBucketInfo = getBucketInfo(omMetadataManager, volumeName, bucketName); | ||
| // check bucket and volume quota | ||
| long preAllocatedSpace = newLocationList.size() | ||
|
|
@@ -310,8 +307,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
| .setOpenVersion(openVersion).build()) | ||
| .setCmdType(Type.CreateFile); | ||
| omClientResponse = new OMFileCreateResponse(omResponse.build(), | ||
| omKeyInfo, missingParentInfos, clientID, omVolumeArgs, | ||
| omBucketInfo.copyObject()); | ||
| omKeyInfo, missingParentInfos, clientID, omBucketInfo.copyObject()); | ||
|
|
||
| result = Result.SUCCESS; | ||
| } catch (IOException ex) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,6 @@ | |
| import org.apache.hadoop.ozone.OzoneConsts; | ||
| import org.apache.hadoop.ozone.om.OMConfigKeys; | ||
| import org.apache.hadoop.ozone.om.helpers.OmBucketInfo; | ||
| import org.apache.hadoop.ozone.om.helpers.OmVolumeArgs; | ||
| import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper; | ||
| import org.apache.hadoop.ozone.om.request.util.OmResponseUtil; | ||
| import org.apache.hadoop.ozone.security.acl.IAccessAuthorizer; | ||
|
|
@@ -123,7 +122,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
|
|
||
| IOException exception = null; | ||
| OmKeyInfo omKeyInfo = null; | ||
| OmVolumeArgs omVolumeArgs = null; | ||
| OmBucketInfo omBucketInfo = null; | ||
| OMClientResponse omClientResponse = null; | ||
| boolean bucketLockAcquired = false; | ||
|
|
@@ -193,7 +191,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
|
|
||
| long scmBlockSize = ozoneManager.getScmBlockSize(); | ||
| int factor = omKeyInfo.getFactor().getNumber(); | ||
| omVolumeArgs = getVolumeInfo(omMetadataManager, volumeName); | ||
| omBucketInfo = getBucketInfo(omMetadataManager, volumeName, bucketName); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment like above. |
||
| // Block was pre-requested and UsedBytes updated when createKey and | ||
| // AllocatedBlock. The space occupied by the Key shall be based on | ||
|
|
@@ -204,8 +201,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | |
| omBucketInfo.incrUsedBytes(correctedSpace); | ||
|
|
||
| omClientResponse = new OMKeyCommitResponse(omResponse.build(), | ||
| omKeyInfo, dbOzoneKey, dbOpenKey, omVolumeArgs, | ||
| omBucketInfo.copyObject()); | ||
| omKeyInfo, dbOzoneKey, dbOpenKey, omBucketInfo.copyObject()); | ||
|
|
||
| result = Result.SUCCESS; | ||
| } catch (IOException ex) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we not remove omVolumeArgs variable defined in this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed it, thanks for catching it.