From 85382305e197fceaa87ec4e2b8d01a5bcecda6da Mon Sep 17 00:00:00 2001 From: Arun Sarin Date: Thu, 8 Jun 2023 16:24:10 +0530 Subject: [PATCH 1/3] HDDS-8373 In quota documentation setquota doesn't accepts decimals --- hadoop-hdds/docs/content/feature/Quota.md | 6 ++++++ hadoop-hdds/docs/content/feature/Quota.zh.md | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/hadoop-hdds/docs/content/feature/Quota.md b/hadoop-hdds/docs/content/feature/Quota.md index 9f243f49921..98060f4386e 100644 --- a/hadoop-hdds/docs/content/feature/Quota.md +++ b/hadoop-hdds/docs/content/feature/Quota.md @@ -70,6 +70,12 @@ f. If the cluster is upgraded from old version less than 1.1.0, use of quota on ### Storage Space level quota Storage space level quotas allow the use of units B, KB, MB, GB and TB. Represents how much storage Spaces will be used. +#### Note: + +- You cannot set the quota of volumes and buckets in decimals. For example, 1.5 TB. + +- Ensure that the minimum storage quota is default block size * replication factor. If you set the value lesser than the default block size * replication factor, while writing the data (key put) operation, an operation error is displayed. + #### Volume Storage Space level quota ```shell bin/ozone sh volume create --space-quota 5MB /volume1 diff --git a/hadoop-hdds/docs/content/feature/Quota.zh.md b/hadoop-hdds/docs/content/feature/Quota.zh.md index f00b3f64649..7d1c7307f5f 100644 --- a/hadoop-hdds/docs/content/feature/Quota.zh.md +++ b/hadoop-hdds/docs/content/feature/Quota.zh.md @@ -67,6 +67,11 @@ menu: ## 客户端用法 ### Storage space级别配额 Storage space级别配额允许使用 B, KB ,MB ,GB ,TB 等单位。表示将使用多少个存储空间。 + +#### 注意: +- Volume 和 Bucket 不支持设置带小数点的配额值,例如 1.5 TB. +- 最小的有效空间配额,是一个数据块需要的存储空间,即默认块大小 * 副本数. 请确保设置的空间配额不小于这个数值,不然对象/文件写入操作,会失败。 + #### Volume Space quota用法 ```shell bin/ozone sh volume create --space-quota 5MB /volume1 From 072b7258ec5b0a209bc5634fd22296e750664689 Mon Sep 17 00:00:00 2001 From: Arun Sarin Date: Thu, 8 Jun 2023 21:53:16 +0530 Subject: [PATCH 2/3] HDDS-8373 Addressed review comments --- .../src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java | 2 +- hadoop-hdds/docs/content/feature/Quota.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java index ec337baa658..8f26ebc4e78 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java +++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java @@ -192,7 +192,7 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) { } catch (NumberFormatException e) { throw new IllegalArgumentException("Invalid values for quota, to ensure" + " that the Quota format is legal(supported values are B," + - " KB, MB, GB and TB). And the quota value cannot be greater than " + + " KB, MB, GB and TB with positive long values). And the quota value cannot be greater than " + "Long.MAX_VALUE BYTES"); } diff --git a/hadoop-hdds/docs/content/feature/Quota.md b/hadoop-hdds/docs/content/feature/Quota.md index 98060f4386e..afa68b98e1f 100644 --- a/hadoop-hdds/docs/content/feature/Quota.md +++ b/hadoop-hdds/docs/content/feature/Quota.md @@ -72,7 +72,7 @@ Storage space level quotas allow the use of units B, KB, MB, GB and TB. Represen #### Note: -- You cannot set the quota of volumes and buckets in decimals. For example, 1.5 TB. +- Decimals are not supported while setting quota for volume and bucket. For example, 1.5 TB. - Ensure that the minimum storage quota is default block size * replication factor. If you set the value lesser than the default block size * replication factor, while writing the data (key put) operation, an operation error is displayed. From 4ed4de5b786cdb44c3245b0dd2932f0f33749eec Mon Sep 17 00:00:00 2001 From: Arun Sarin Date: Fri, 9 Jun 2023 11:41:38 +0530 Subject: [PATCH 3/3] HDDS-8373. Fixed checkstyle issue --- .../java/org/apache/hadoop/hdds/client/OzoneQuota.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java index 8f26ebc4e78..04996f10b43 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java +++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java @@ -191,9 +191,10 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) { nSize = Long.parseLong(size); } catch (NumberFormatException e) { throw new IllegalArgumentException("Invalid values for quota, to ensure" + - " that the Quota format is legal(supported values are B," + - " KB, MB, GB and TB with positive long values). And the quota value cannot be greater than " + - "Long.MAX_VALUE BYTES"); + " that the Quota format is legal(supported values are B," + + " KB, MB, GB and TB with positive long values)." + + " And the quota value cannot be greater than " + + "Long.MAX_VALUE BYTES"); } if (nSize <= 0) {