Skip to content

Commit b479a38

Browse files
authored
HDDS-8373. Document that setquota doesn't accept decimals (#4856)
* HDDS-8373 In quota documentation setquota doesn't accepts decimals * HDDS-8373 Addressed review comments * HDDS-8373. Fixed checkstyle issue --------- Co-authored-by: Arun Sarin <asarin@cloudera.com>
1 parent 56a46ee commit b479a38

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
191191
nSize = Long.parseLong(size);
192192
} catch (NumberFormatException e) {
193193
throw new IllegalArgumentException("Invalid values for quota, to ensure" +
194-
" that the Quota format is legal(supported values are B," +
195-
" KB, MB, GB and TB). And the quota value cannot be greater than " +
196-
"Long.MAX_VALUE BYTES");
194+
" that the Quota format is legal(supported values are B," +
195+
" KB, MB, GB and TB with positive long values)." +
196+
" And the quota value cannot be greater than " +
197+
"Long.MAX_VALUE BYTES");
197198
}
198199

199200
if (nSize <= 0) {

hadoop-hdds/docs/content/feature/Quota.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ f. If the cluster is upgraded from old version less than 1.1.0, use of quota on
7070
### Storage Space level quota
7171
Storage space level quotas allow the use of units B, KB, MB, GB and TB. Represents how much storage Spaces will be used.
7272

73+
#### Note:
74+
75+
- Decimals are not supported while setting quota for volume and bucket. For example, 1.5 TB.
76+
77+
- 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.
78+
7379
#### Volume Storage Space level quota
7480
```shell
7581
bin/ozone sh volume create --space-quota 5MB /volume1

hadoop-hdds/docs/content/feature/Quota.zh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ menu:
6767
## 客户端用法
6868
### Storage space级别配额
6969
Storage space级别配额允许使用 B, KB ,MB ,GB ,TB 等单位。表示将使用多少个存储空间。
70+
71+
#### 注意:
72+
- Volume 和 Bucket 不支持设置带小数点的配额值,例如 1.5 TB.
73+
- 最小的有效空间配额,是一个数据块需要的存储空间,即默认块大小 * 副本数. 请确保设置的空间配额不小于这个数值,不然对象/文件写入操作,会失败。
74+
7075
#### Volume Space quota用法
7176
```shell
7277
bin/ozone sh volume create --space-quota 5MB /volume1

0 commit comments

Comments
 (0)