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



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3540,6 +3546,43 @@ public boolean getEnableFileSystemPaths() {
         OZONE_OM_ENABLE_FILESYSTEM_PATHS_DEFAULT);
   }
 
+  /**
+   * Initialize volume's quota, which resolves the problem that the old quota
+   * initial value was not set correctly. This method will be removed in a
+   * later version.
+   * @throws IOException
+   */
+  private void initializeOldVolumeQuota() throws IOException {
+
+    TableIterator<String, ? extends Table.KeyValue<String,
+         OmVolumeArgs>> iterator = metadataManager.getVolumeTable().iterator();
+    while(iterator.hasNext()) {
+      OmVolumeArgs omVolumeArgs = iterator.next().getValue();
+      String omVolumeKey = metadataManager.getVolumeKey(
+          omVolumeArgs.getVolume());
+      // Previously, the volume quota was created to default to 1EB. To change
+      // to -1, default does not enable quota.
+      if (omVolumeArgs.getQuotaInBytes() == 1024 * 1024 * TB ||

Review comment:
       Currently, the way to determine the old quota is by seeing whether his 
quota is 1 EB. So 1EB is still a special value. At present, OZone's cluster 
size is not large, far from the upper limit of 1EB.
   So can we ignore this case? In addition, I adjust the LOG level from INFO to 
Warn (I can change it to error if needed) to alert the user that the 
corresponding quota has been changed.
   




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