linyiqun edited a comment on pull request #1746:
URL: https://github.com/apache/ozone/pull/1746#issuecomment-757158465
>I agree that we need to distinguish between these two different behaviors
of the user. ”Don't allow 0 can be set“ It's our purpose,also agree this. The
point is, how do we do that?
@captainzmc , here I mean don't allow 0 can be set in quota from the client
side. So we can just add limit check in OzoneQuota#parseQuota and
RpcClient#verifyCountsQuota/verifySpaceQuota.
I see OmVolumeArgs resets the quotaInBytes/quotaInNamespace to
OzoneConsts.QUOTA_RESET in its builder function. We can also make this change
in OmBucketArgs# builder constructor. In addition, we should also reset quota
when 0 was passed in constructor method.
```java
private OmBucketArgs(String volumeName, String bucketName,
Boolean isVersionEnabled, StorageType storageType,
Map<String, String> metadata, long quotaInBytes, long
quotaInNamespace) {
this.volumeName = volumeName;
this.bucketName = bucketName;
this.isVersionEnabled = isVersionEnabled;
this.storageType = storageType;
this.metadata = metadata;
// if quota is 0, reset to OzoneConsts.QUOTA_RESET
this.quotaInBytes = quotaInBytes;
this.quotaInNamespace = quotaInNamespace;
}
```
Does this make sense to you?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]