You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "devabhishekpal (via GitHub)" <gi...@apache.org> on 2024/08/12 11:04:40 UTC
[PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
devabhishekpal opened a new pull request, #7060:
URL: https://github.com/apache/ozone/pull/7060
## What changes were proposed in this pull request?
HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs
Please describe your PR in detail:
* [HDDS-2416](https://issues.apache.org/jira/browse/HDDS-2416) was introduced as an OM Trash feature
* Later [HDDS-3367](https://issues.apache.org/jira/browse/HDDS-3367) improves upon the above and implements a trash similar to HDFS.
* Since we are no longer using the Trash APIs we can remove them and mark the definitions as deprecated
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11251
## How was this patch tested?
Patch was tested via unit tests
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1730996066
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -243,6 +243,10 @@ public static boolean isReadOnly(
case ListKeys:
case ListKeysLight:
case ListTrash:
+ // This is deprecated by HDDS-11251. Keeping this in here
Review Comment:
For me it is not clear if this comment is talking about ListTrash, or ServiceList. Can we write ListTrash is deprecated... instead? I know if one gets the git annotate output, or if one checks the JIRA then it is clear what the comment is talking about, but that requires an extra hop, so I would like to make our life easier later with this change. Same goes to the other comment for RecoverTrash.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1720666169
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1762,20 +1762,15 @@ public List<OzoneKey> listKeys(String volumeName, String bucketName,
@Override
public List<RepeatedOmKeyInfo> listTrash(String volumeName, String bucketName,
String startKeyName, String keyPrefix, int maxKeys) throws IOException {
-
- Preconditions.checkNotNull(volumeName);
- Preconditions.checkNotNull(bucketName);
-
- return ozoneManagerClient.listTrash(volumeName, bucketName, startKeyName,
- keyPrefix, maxKeys);
+ // listTrash is deprecated
+ throw new UnsupportedOperationException();
Review Comment:
Updated in the latest commit [b645e54](https://github.com/apache/ozone/pull/7060/commits/b645e5448bf06a866dfff844e640a6bd64053bf9)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2297905457
@devabhishekpal There is one test failure regarding `TestOmMetrics`, could you help address it?
https://github.com/devabhishekpal/ozone/actions/runs/10449138799/job/28947749624
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1714960386
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2946,33 +2946,8 @@ public ListKeysLightResult listKeysLight(String volumeName,
public List<RepeatedOmKeyInfo> listTrash(String volumeName,
String bucketName, String startKeyName, String keyPrefix, int maxKeys)
throws IOException {
- boolean auditSuccess = true;
Review Comment:
Same as the previous comments (for the other portions of code as well)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2294906535
Hi @ivandika3 , thanks for your inputs.
So previously I was marking the methods as deprecated and in the implementations I was throwing `UnsupportedOperationException` so that we can know if something is breaking due to the change without affecting anything major.
Would you suggest to completely remove the code?
For the protofiles I am not sure how the lock-files are generated.
I believe as long as we are not affecting existing numbering for other fields we should be good with removing the listTrash and recoverTrash declarations.
@tanvipenumudy what do you think?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2295819973
@devabhishekpal I think we can keep the cases for listTrash and recoverTrash in `OmUtils#isReadOnly` similar to `PurgePaths` in https://github.com/apache/ozone/pull/3480
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2295130976
#6725 removed another "not completely implemented" feature without deprecation. I guess we can remove this one, too.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2312023743
Thanks @devabhishekpal for the patch, and @adoroszlai , @tanvipenumudy , and @fapifta for the reviews.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2295114261
> Would you suggest to completely remove the code?
@devabhishekpal Yes, since these APIs are never implemented and therefore should never be used.
@adoroszlai Kindly need your input.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2295612915
@devabhishekpal Thanks for the update. The current changes LGTM.
Could you help fix the failed tests?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2294813113
@devabhishekpal Thanks for taking this up. @tanvipenumudy in my opinion, I would prefer to remove the codes entirely instead of adding `@deprecated` annotation since these APIs should never be used at all because the feature has not been completed yet.
What do you think?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1720665951
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2946,33 +2946,8 @@ public ListKeysLightResult listKeysLight(String volumeName,
public List<RepeatedOmKeyInfo> listTrash(String volumeName,
String bucketName, String startKeyName, String keyPrefix, int maxKeys)
throws IOException {
- boolean auditSuccess = true;
Review Comment:
Updated in the latest commit [b645e54](https://github.com/apache/ozone/pull/7060/commits/b645e5448bf06a866dfff844e640a6bd64053bf9)
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1762,20 +1762,15 @@ public List<OzoneKey> listKeys(String volumeName, String bucketName,
@Override
public List<RepeatedOmKeyInfo> listTrash(String volumeName, String bucketName,
String startKeyName, String keyPrefix, int maxKeys) throws IOException {
-
- Preconditions.checkNotNull(volumeName);
- Preconditions.checkNotNull(bucketName);
-
- return ozoneManagerClient.listTrash(volumeName, bucketName, startKeyName,
- keyPrefix, maxKeys);
+ // listTrash is deprecated
+ throw new UnsupportedOperationException();
}
@Override
public boolean recoverTrash(String volumeName, String bucketName,
String keyName, String destinationBucket) throws IOException {
-
- return ozoneManagerClient.recoverTrash(volumeName, bucketName, keyName,
- destinationBucket);
+ //recoverTrash is deprecated
+ throw new UnsupportedOperationException();
Review Comment:
Updated in the latest commit [b645e54](https://github.com/apache/ozone/pull/7060/commits/b645e5448bf06a866dfff844e640a6bd64053bf9)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2294695342
Hello @tanvipenumudy,
Thanks a lot for taking a look at this PR.
I restored the functionality for the methods and marked them as `@Deprecated`.
Could please take another look?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2296439483
Thank you @ivandika3 and @adoroszlai for your opinions as well.
I believe it's safe to remove the method definitions since the feature isn't completed yet. However, if these methods were previously in use, we need to ensure compatibility and thoroughly test the same.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1714948574
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1762,20 +1762,15 @@ public List<OzoneKey> listKeys(String volumeName, String bucketName,
@Override
public List<RepeatedOmKeyInfo> listTrash(String volumeName, String bucketName,
String startKeyName, String keyPrefix, int maxKeys) throws IOException {
-
- Preconditions.checkNotNull(volumeName);
- Preconditions.checkNotNull(bucketName);
-
- return ozoneManagerClient.listTrash(volumeName, bucketName, startKeyName,
- keyPrefix, maxKeys);
+ // listTrash is deprecated
+ throw new UnsupportedOperationException();
}
@Override
public boolean recoverTrash(String volumeName, String bucketName,
String keyName, String destinationBucket) throws IOException {
-
- return ozoneManagerClient.recoverTrash(volumeName, bucketName, keyName,
- destinationBucket);
+ //recoverTrash is deprecated
+ throw new UnsupportedOperationException();
Review Comment:
Similar to the previous comment, do we just mark the method with a `@Deprecated` annotation instead?
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1762,20 +1762,15 @@ public List<OzoneKey> listKeys(String volumeName, String bucketName,
@Override
public List<RepeatedOmKeyInfo> listTrash(String volumeName, String bucketName,
String startKeyName, String keyPrefix, int maxKeys) throws IOException {
-
- Preconditions.checkNotNull(volumeName);
- Preconditions.checkNotNull(bucketName);
-
- return ozoneManagerClient.listTrash(volumeName, bucketName, startKeyName,
- keyPrefix, maxKeys);
+ // listTrash is deprecated
+ throw new UnsupportedOperationException();
Review Comment:
Should we mark the methods with a `@Deprecated` annotation instead of removing their implementation and throwing an `UnsupportedOperationException`, for the sake of consistency
Perhaps similar to `setEncryptionKey()` and `renameKeys()` APIs (now deprecated)?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1722649186
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2942,39 +2941,6 @@ public ListKeysLightResult listKeysLight(String volumeName,
return new ListKeysLightResult(basicKeysList, listKeysResult.isTruncated());
}
- @Override
- public List<RepeatedOmKeyInfo> listTrash(String volumeName,
- String bucketName, String startKeyName, String keyPrefix, int maxKeys)
- throws IOException {
- boolean auditSuccess = true;
- Map<String, String> auditMap = buildAuditMap(volumeName);
- auditMap.put(OzoneConsts.BUCKET, bucketName);
- auditMap.put(OzoneConsts.START_KEY, startKeyName);
- auditMap.put(OzoneConsts.KEY_PREFIX, keyPrefix);
- auditMap.put(OzoneConsts.MAX_KEYS, String.valueOf(maxKeys));
- try {
- if (isAclEnabled) {
- omMetadataReader.checkAcls(ResourceType.BUCKET,
- StoreType.OZONE, ACLType.LIST,
- volumeName, bucketName, keyPrefix);
- }
- metrics.incNumTrashKeyLists();
Review Comment:
Please remove the key trash related metrics in `OmMetrics` as well:
- numTrashKeyLists
- numTrashKeyListFails
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1724548227
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2942,39 +2941,6 @@ public ListKeysLightResult listKeysLight(String volumeName,
return new ListKeysLightResult(basicKeysList, listKeysResult.isTruncated());
}
- @Override
- public List<RepeatedOmKeyInfo> listTrash(String volumeName,
- String bucketName, String startKeyName, String keyPrefix, int maxKeys)
- throws IOException {
- boolean auditSuccess = true;
- Map<String, String> auditMap = buildAuditMap(volumeName);
- auditMap.put(OzoneConsts.BUCKET, bucketName);
- auditMap.put(OzoneConsts.START_KEY, startKeyName);
- auditMap.put(OzoneConsts.KEY_PREFIX, keyPrefix);
- auditMap.put(OzoneConsts.MAX_KEYS, String.valueOf(maxKeys));
- try {
- if (isAclEnabled) {
- omMetadataReader.checkAcls(ResourceType.BUCKET,
- StoreType.OZONE, ACLType.LIST,
- volumeName, bucketName, keyPrefix);
- }
- metrics.incNumTrashKeyLists();
Review Comment:
Addressed in the latest commit [aa5e8b6](https://github.com/apache/ozone/pull/7060/commits/aa5e8b6046d0208524ae49c16de227a2492e8c5f)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1721307714
##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -97,6 +97,7 @@ enum Type {
ListMultipartUploads = 82;
+ // Not used anymore due to HDDS-11251
ListTrash = 91;
RecoverTrash = 92;
Review Comment:
Let's add the `// [deprecated = true]` similar to `PurgePaths`
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on PR #7060:
URL: https://github.com/apache/ozone/pull/7060#issuecomment-2295781075
Hi @ivandika3 @adoroszlai ,
It seems the failure in the [build-branch / CI / integration (om)](https://github.com/apache/ozone/actions/runs/10442489168/job/28922224092) is because the generated proto file has the enum for [ListTrash](https://github.com/apache/ozone/blob/7f24f2d3e41c4bffb94bd93b4b1adcf075da082c/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto#L100) and [RecoverTrash](https://github.com/apache/ozone/blob/7f24f2d3e41c4bffb94bd93b4b1adcf075da082c/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto#L101) present.
But in the code for the test we are missing this from the OmUtils switch-case.
So I tried out with marking the enum numbers as reserved, also tried marking as deprecated.
But it seems in current protoc version this is not supported. So there are the following ways:
- Keep the cases for listTrash and recoverTrash in switch() in OmUtils, but all other references are removed, so unless there is any way in which this switch case is being hit apart from via the test it won't break anything
- Restore the method definitions, throw an `UnsupportedOperationException()` on the implementations and marking both interface and impl as deprecated. When we are upgraded to protoc3 I believe we can safely remove these defs.
Wanted inputs on this and if there is any other way.
Thanks
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1714947032
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1762,20 +1762,15 @@ public List<OzoneKey> listKeys(String volumeName, String bucketName,
@Override
public List<RepeatedOmKeyInfo> listTrash(String volumeName, String bucketName,
String startKeyName, String keyPrefix, int maxKeys) throws IOException {
-
- Preconditions.checkNotNull(volumeName);
- Preconditions.checkNotNull(bucketName);
-
- return ozoneManagerClient.listTrash(volumeName, bucketName, startKeyName,
- keyPrefix, maxKeys);
+ // listTrash is deprecated
+ throw new UnsupportedOperationException();
Review Comment:
Should we mark the methods with a `@Deprecated` annotation instead of removing their implementation and throwing an `UnsupportedOperationException`, for the sake of consistency?
Perhaps similar to `setEncryptionKey()` and `renameKeys()` APIs (now deprecated).
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1732189211
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -243,6 +243,10 @@ public static boolean isReadOnly(
case ListKeys:
case ListKeysLight:
case ListTrash:
+ // This is deprecated by HDDS-11251. Keeping this in here
Review Comment:
Addressed in the latest commit [3172f3c](https://github.com/apache/ozone/pull/7060/commits/3172f3c9f13cfc3d4779871bb8e484f0aca889c5)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 merged PR #7060:
URL: https://github.com/apache/ozone/pull/7060
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1721334064
##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -97,6 +97,7 @@ enum Type {
ListMultipartUploads = 82;
+ // Not used anymore due to HDDS-11251
ListTrash = 91;
RecoverTrash = 92;
Review Comment:
Addressed this in the latest commit
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11251. Deprecate definitions and remove listTrash and recoverTrash APIs [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #7060:
URL: https://github.com/apache/ozone/pull/7060#discussion_r1722649186
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2942,39 +2941,6 @@ public ListKeysLightResult listKeysLight(String volumeName,
return new ListKeysLightResult(basicKeysList, listKeysResult.isTruncated());
}
- @Override
- public List<RepeatedOmKeyInfo> listTrash(String volumeName,
- String bucketName, String startKeyName, String keyPrefix, int maxKeys)
- throws IOException {
- boolean auditSuccess = true;
- Map<String, String> auditMap = buildAuditMap(volumeName);
- auditMap.put(OzoneConsts.BUCKET, bucketName);
- auditMap.put(OzoneConsts.START_KEY, startKeyName);
- auditMap.put(OzoneConsts.KEY_PREFIX, keyPrefix);
- auditMap.put(OzoneConsts.MAX_KEYS, String.valueOf(maxKeys));
- try {
- if (isAclEnabled) {
- omMetadataReader.checkAcls(ResourceType.BUCKET,
- StoreType.OZONE, ACLType.LIST,
- volumeName, bucketName, keyPrefix);
- }
- metrics.incNumTrashKeyLists();
Review Comment:
Please remove the key trash related metrics in `OmMetrics` as well.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org