-
Notifications
You must be signed in to change notification settings - Fork 625
HDDS-12983. Validator Registry Changes for Supporting Version based validations #8404
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
Closed
Closed
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2fb399c
HDDS-12983. Validator Registry Changes for Supporting Version based v…
swamirishi 16dd2d2
HDDS-12983. Revert module move change
swamirishi de26a00
HDDS-12983. Fix Validator registry
swamirishi bf98388
HDDS-12983. Change key to validator map
swamirishi 36cd0d5
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi d4b9b33
HDDS-12983. Address review comments
swamirishi 64e0f58
HDDS-12983. Fix checkstyle issue
swamirishi 4e18baa
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 3ffac6c
Resolve merge conflicts
swamirishi 979c455
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi 3743515
HDDS-12983. Fix checkstyle
swamirishi 5c37a3f
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi a3a696c
HDDS-12983. Address review comments
swamirishi 33deff8
remove unecessary copy
adoroszlai 9543c46
Merge remote-tracking branch 'origin/master' into HDDS-12983
adoroszlai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
| import org.apache.hadoop.ozone.ClientVersion; | ||
| import org.apache.hadoop.ozone.OmUtils; | ||
| import org.apache.hadoop.ozone.audit.AuditLogger; | ||
| import org.apache.hadoop.ozone.audit.OMAction; | ||
|
|
@@ -44,8 +45,8 @@ | |
| import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; | ||
| import org.apache.hadoop.ozone.om.request.key.OMKeyRequest; | ||
| import org.apache.hadoop.ozone.om.request.util.OmResponseUtil; | ||
| import org.apache.hadoop.ozone.om.request.validation.RequestFeatureValidator; | ||
| import org.apache.hadoop.ozone.om.request.validation.ValidationCondition; | ||
| import org.apache.hadoop.ozone.om.request.validation.OMClientVersionValidator; | ||
| import org.apache.hadoop.ozone.om.request.validation.OMLayoutVersionValidator; | ||
| import org.apache.hadoop.ozone.om.request.validation.ValidationContext; | ||
| import org.apache.hadoop.ozone.om.response.OMClientResponse; | ||
| import org.apache.hadoop.ozone.om.response.file.OMDirectoryCreateResponse; | ||
|
|
@@ -262,10 +263,10 @@ private void logResult(CreateDirectoryRequest createDirectoryRequest, | |
| } | ||
| } | ||
|
|
||
| @RequestFeatureValidator( | ||
| conditions = ValidationCondition.CLUSTER_NEEDS_FINALIZATION, | ||
| @OMLayoutVersionValidator( | ||
| processingPhase = RequestProcessingPhase.PRE_PROCESS, | ||
| requestType = Type.CreateDirectory | ||
| requestType = Type.CreateDirectory, | ||
| applyBefore = OMLayoutFeature.ERASURE_CODED_STORAGE_SUPPORT | ||
|
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. Please simply replace the two changed lines instead of moving things around. - @RequestFeatureValidator(
- conditions = ValidationCondition.CLUSTER_NEEDS_FINALIZATION,
+ @OMLayoutVersionValidator(
+ applyBefore = OMLayoutFeature.ERASURE_CODED_STORAGE_SUPPORT,
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 |
||
| ) | ||
| public static OMRequest disallowCreateDirectoryWithECReplicationConfig( | ||
| OMRequest req, ValidationContext ctx) throws OMException { | ||
|
|
@@ -295,10 +296,10 @@ public static OMRequest disallowCreateDirectoryWithECReplicationConfig( | |
| * @return the validated request | ||
| * @throws OMException if the request is invalid | ||
| */ | ||
| @RequestFeatureValidator( | ||
| conditions = ValidationCondition.OLDER_CLIENT_REQUESTS, | ||
| @OMClientVersionValidator( | ||
| processingPhase = RequestProcessingPhase.PRE_PROCESS, | ||
| requestType = Type.CreateDirectory | ||
| requestType = Type.CreateDirectory, | ||
| applyBefore = ClientVersion.BUCKET_LAYOUT_SUPPORT | ||
| ) | ||
| public static OMRequest blockCreateDirectoryWithBucketLayoutFromOldClient( | ||
| OMRequest req, ValidationContext ctx) throws IOException { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Created #9530 to reduce the change that this PR needs to make in POM files. The other PR:
RequestFeatureValidatorfrom modules where it's not even accessibleSo this PR will only need to update POMs for the removal of
RequestFeatureValidator, and only in fewer modules.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.
merged with master branch