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



##########
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 ||
+          omVolumeArgs.getQuotaInBytes() == OzoneConsts.MAX_QUOTA_IN_BYTES) {

Review comment:
       This judgment is redundant, will delete it.




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