[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-29 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r496662068



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##
@@ -441,6 +431,8 @@ public void createBucket(
 verifyVolumeName(volumeName);
 verifyBucketName(bucketName);
 Preconditions.checkNotNull(bucketArgs);
+verifyCountsQuota(bucketArgs.getQuotaInCounts());
+verifySpaceQuota(bucketArgs.getQuotaInBytes());

Review comment:
   The PR of createVolume did not add a checkmark before, I will add this 
in the createVolume.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-28 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r496451487



##
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##
@@ -192,6 +192,10 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
 throw new OMException("Bucket already exist", BUCKET_ALREADY_EXISTS);
   }
 
+  //Check quotaInBytes and quotaInCounts to update
+  checkQuotaBytesValid(omVolumeArgs, omBucketInfo);
+  checkQuotaCountsValid(omVolumeArgs, omBucketInfo);

Review comment:
   Thanks @adoroszlai for the advice, the check action needs to get the 
volume or bucket in DB, so it better to do this action after acquiring the 
lock.  And other comments has been fixed.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-17 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r490270995



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##
@@ -598,6 +628,20 @@ public void setBucketStorageType(
 ozoneManagerClient.setBucketProperty(builder.build());
   }
 
+  @Override
+  public void setBucketQuota(String volumeName, String bucketName,
+  long quotaInCounts, long quotaInBytes) throws IOException {
+HddsClientUtils.verifyResourceName(bucketName);
+verifyQuota(quotaInCounts, quotaInBytes);
+OmBucketArgs.Builder builder = OmBucketArgs.newBuilder();
+builder.setVolumeName(volumeName)
+.setBucketName(bucketName)
+.setQuotaInBytes(quotaInBytes)
+.setQuotaInCounts(quotaInCounts);
+ozoneManagerClient.setBucketProperty(builder.build());

Review comment:
   Bucket provides the setBucketProperty method and the corresponding 
request to modify the bucket information. This method already exists and is not 
something I added later. So here I'm reusing the method.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-17 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r490257305



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##
@@ -439,6 +434,15 @@ public void createBucket(
 verifyVolumeName(volumeName);
 verifyBucketName(bucketName);
 Preconditions.checkNotNull(bucketArgs);
+verifyCountsQuota(bucketArgs.getQuotaInCounts());
+verifySpaceQuota(bucketArgs.getQuotaInBytes());
+
+// When creating buckets using the API, if the user does not specify quota,
+// 0 is passed in by default, which should be set to -1.

Review comment:
   In proto unsigned field can't have negative default value. The logic 
here is the same and I can encapsulate it as a method, which should be better





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-17 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r490231852



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/BucketArgs.java
##
@@ -57,6 +57,9 @@
   private final String sourceVolume;
   private final String sourceBucket;
 
+  private long quotaInBytes;

Review comment:
   I will change the String in VolumeArgs to long





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-15 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r488534476



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##
@@ -464,6 +469,8 @@ public void createBucket(
 .setStorageType(storageType)
 .setSourceVolume(bucketArgs.getSourceVolume())
 .setSourceBucket(bucketArgs.getSourceBucket())
+.setQuotaInBytes(quotaInBytes)
+.setQuotaInCounts(quotaInCounts)

Review comment:
   I had added a verify method In new 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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-15 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r488534476



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##
@@ -464,6 +469,8 @@ public void createBucket(
 .setStorageType(storageType)
 .setSourceVolume(bucketArgs.getSourceVolume())
 .setSourceBucket(bucketArgs.getSourceBucket())
+.setQuotaInBytes(quotaInBytes)
+.setQuotaInCounts(quotaInCounts)

Review comment:
   Had added a verify method In RpcClient.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org



[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1412: HDDS-3751. Ozone sh client support bucket quota option.

2020-09-15 Thread GitBox


captainzmc commented on a change in pull request #1412:
URL: https://github.com/apache/hadoop-ozone/pull/1412#discussion_r488511539



##
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java
##
@@ -174,6 +184,20 @@ public OzoneBucket(ConfigurationSource conf, 
ClientProtocol proxy,
 this.modificationTime = Instant.ofEpochMilli(modificationTime);
   }
 
+  @SuppressWarnings("parameternumber")

Review comment:
   Thanks for @amaliujia‘s review.
   Ozone's CheckStyle requires that the number of method variables must not 
exceed a certain value, or the check fails.  [So it borrows from other 
usage.](https://github.com/apache/hadoop-ozone/blob/d34ab29b622168c57bd2d3049d060c42735de7f4/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java#L207)





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org