chungen0126 commented on code in PR #11789:
URL: https://github.com/apache/ozone/pull/11789#discussion_r4398720784
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -3122,28 +3146,28 @@ public void setVerifyChecksum(boolean verifyChecksum) {
public LeaseKeyInfo recoverLease(String volumeName, String bucketName,
String keyName, boolean force)
throws IOException {
- if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(omVersion)) {
+ if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(getOmVersion())) {
throw new UnsupportedOperationException("Lease recovery API requires OM
version "
+ OzoneManagerVersion.HBASE_SUPPORT + " or later. Current OM version
"
- + omVersion);
+ + getOmVersion());
Review Comment:
Nit: Since `getOmVersion()` can now be updated dynamically, calling it twice
might produce a confusing exception message if a refresh completes between the
`isSupportedBy` check and the second call.
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -3122,28 +3146,28 @@ public void setVerifyChecksum(boolean verifyChecksum) {
public LeaseKeyInfo recoverLease(String volumeName, String bucketName,
String keyName, boolean force)
throws IOException {
- if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(omVersion)) {
+ if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(getOmVersion())) {
throw new UnsupportedOperationException("Lease recovery API requires OM
version "
+ OzoneManagerVersion.HBASE_SUPPORT + " or later. Current OM version
"
- + omVersion);
+ + getOmVersion());
}
return ozoneManagerClient.recoverLease(volumeName, bucketName, keyName,
force);
}
@Override
public void recoverKey(OmKeyArgs args, long clientID) throws IOException {
- if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(omVersion)) {
+ if (!OzoneManagerVersion.HBASE_SUPPORT.isSupportedBy(getOmVersion())) {
throw new UnsupportedOperationException("Lease recovery API requires OM
version "
+ OzoneManagerVersion.HBASE_SUPPORT + " or later. Current OM version
"
- + omVersion);
+ + getOmVersion());
Review Comment:
Nit: Since `getOmVersion()` can now be updated dynamically, calling it twice
might produce a confusing exception message if a refresh completes between the
`isSupportedBy` check and the second call.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]