You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/23 03:49:28 UTC

[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2357: HDDS-5362. [FSO] Support bucket types in OM

bharatviswa504 commented on a change in pull request #2357:
URL: https://github.com/apache/ozone/pull/2357#discussion_r656735557



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BucketType.java
##########
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.helpers;
+
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+
+/**
+ * The replication type to be used while writing key into ozone.
+ */
+public enum BucketType {
+  FSO, OBJECT_STORE, LEGACY;
+  public static final BucketType DEFAULT = OBJECT_STORE;
+  public static BucketType fromProto(
+      OzoneManagerProtocolProtos.BucketTypeProto bucketType) {
+    if (bucketType == null) {
+      return BucketType.LEGACY;
+    }
+    switch (bucketType) {
+    case FSO:
+      return BucketType.FSO;
+    case OBJECT_STORE:
+    default:
+      return DEFAULT;
+    }
+  }
+
+  public OzoneManagerProtocolProtos.BucketTypeProto toProto() {
+    switch (this) {
+    case FSO:
+      return OzoneManagerProtocolProtos.BucketTypeProto.FSO;
+    case OBJECT_STORE:
+      return OzoneManagerProtocolProtos.BucketTypeProto.OBJECT_STORE;
+    case LEGACY:

Review comment:
       Should not be LEGACY be categorized in to 2 types.
   LEGACY_FSO and LEGACY_OBJECT_STORE based on ozone.om.enable.filesystem.paths config




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org