-
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
Changes from 3 commits
2fb399c
16dd2d2
de26a00
bf98388
36cd0d5
d4b9b33
64e0f58
4e18baa
3ffac6c
979c455
3743515
5c37a3f
a3a696c
33deff8
9543c46
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,8 +53,8 @@ | |||||
| import org.apache.hadoop.ozone.om.helpers.OzoneAclUtil; | ||||||
| import org.apache.hadoop.ozone.om.request.OMClientRequest; | ||||||
| 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.bucket.OMBucketCreateResponse; | ||||||
|
|
@@ -397,10 +397,10 @@ public boolean checkQuotaBytesValid(OMMetadataManager metadataManager, | |||||
|
|
||||||
| } | ||||||
|
|
||||||
| @RequestFeatureValidator( | ||||||
| conditions = ValidationCondition.CLUSTER_NEEDS_FINALIZATION, | ||||||
| @OMLayoutVersionValidator( | ||||||
| processingPhase = RequestProcessingPhase.PRE_PROCESS, | ||||||
| requestType = Type.CreateBucket | ||||||
| requestType = Type.CreateBucket, | ||||||
| applyBefore = OMLayoutFeature.ERASURE_CODED_STORAGE_SUPPORT | ||||||
| ) | ||||||
| public static OMRequest disallowCreateBucketWithECReplicationConfig( | ||||||
| OMRequest req, ValidationContext ctx) throws OMException { | ||||||
|
|
@@ -420,10 +420,10 @@ public static OMRequest disallowCreateBucketWithECReplicationConfig( | |||||
| return req; | ||||||
| } | ||||||
|
|
||||||
| @RequestFeatureValidator( | ||||||
| conditions = ValidationCondition.CLUSTER_NEEDS_FINALIZATION, | ||||||
| @OMLayoutVersionValidator( | ||||||
| processingPhase = RequestProcessingPhase.PRE_PROCESS, | ||||||
| requestType = Type.CreateBucket | ||||||
| requestType = Type.CreateBucket, | ||||||
| applyBefore = OMLayoutFeature.BUCKET_LAYOUT_SUPPORT | ||||||
| ) | ||||||
| public static OMRequest handleCreateBucketWithBucketLayoutDuringPreFinalize( | ||||||
| OMRequest req, ValidationContext ctx) throws OMException { | ||||||
|
|
@@ -461,10 +461,10 @@ public static OMRequest handleCreateBucketWithBucketLayoutDuringPreFinalize( | |||||
| * write to them, instead of using the server default which may be in a layout | ||||||
| * they do not understand. | ||||||
| */ | ||||||
| @RequestFeatureValidator( | ||||||
| conditions = ValidationCondition.OLDER_CLIENT_REQUESTS, | ||||||
| @OMClientVersionValidator( | ||||||
| processingPhase = RequestProcessingPhase.PRE_PROCESS, | ||||||
| requestType = Type.CreateBucket | ||||||
| requestType = Type.CreateBucket, | ||||||
| applyBefore = ClientVersion.BUCKET_LAYOUT_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. nit:
Suggested change
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 setDefaultBucketLayoutForOlderClients(OMRequest req, | ||||||
| ValidationContext ctx) { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import java.nio.file.Paths; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import org.apache.hadoop.ozone.ClientVersion; | ||
| import org.apache.hadoop.ozone.audit.AuditLogger; | ||
| import org.apache.hadoop.ozone.audit.OMAction; | ||
| import org.apache.hadoop.ozone.om.OMMetadataManager; | ||
|
|
@@ -43,8 +44,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 { | ||
|
|
||
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