timmylicheng commented on a change in pull request #1041:
URL: https://github.com/apache/hadoop-ozone/pull/1041#discussion_r440104690



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
##########
@@ -255,10 +255,9 @@ public void testSetVolumeQuota()
       throws IOException {
     String volumeName = UUID.randomUUID().toString();
     store.createVolume(volumeName);
-    store.getVolume(volumeName).setQuota(
-        OzoneQuota.parseQuota("100000000 BYTES"));
+    store.getVolume(volumeName).setQuota(OzoneQuota.parseQuota("1GB", 0L));
     OzoneVolume volume = store.getVolume(volumeName);
-    Assert.assertEquals(100000000L, volume.getQuota());
+    Assert.assertEquals(1073741824L, volume.getStoragespaceQuota());

Review comment:
       how about some number * 1024?

##########
File path: hadoop-hdds/docs/content/shell/VolumeCommands.md
##########
@@ -42,7 +42,7 @@ assign it to a user.
 |  Uri                           | The name of the volume.                     
                   |
 
 {{< highlight bash >}}
-ozone sh volume create --quota=1TB --user=bilbo /hive
+ozone sh volume create -ssq=1TB --user=bilbo /hive

Review comment:
       I would prefer quota in admin command IMO

##########
File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -25,26 +25,75 @@
  * represents an OzoneQuota Object that can be applied to
  * a storage volume.
  */
-public class OzoneQuota {
+public final class OzoneQuota {
 
   public static final String OZONE_QUOTA_BYTES = "BYTES";
+  public static final String OZONE_QUOTA_KB = "KB";
   public static final String OZONE_QUOTA_MB = "MB";
   public static final String OZONE_QUOTA_GB = "GB";
   public static final String OZONE_QUOTA_TB = "TB";
 
-  private Units unit;
-  private long size;
-
   /** Quota Units.*/
   public enum Units {UNDEFINED, BYTES, KB, MB, GB, TB}
 
+  // Quota to decide how many buckets or keys can be created.
+  private long namespaceQuota;
+  // Quota to decide how many storage space will be used in bytes.
+  private long storagespaceQuota;
+  private RawStorageSpaceQuota rawStoragespaceQuota;
+
+  private static class RawStorageSpaceQuota {
+    private Units unit;
+    private long size;
+
+    RawStorageSpaceQuota(Units unit, long size) {
+      this.unit = unit;
+      this.size = size;
+    }
+
+    public Units getUnit() {
+      return unit;
+    }
+
+    public long getSize() {
+      return size;
+    }
+
+    /**
+     * Returns size in Bytes or -1 if there is no Quota.
+     */
+    public long sizeInBytes() {

Review comment:
       Why not just use OzoneConsts?




----------------------------------------------------------------
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

Reply via email to