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/03/26 04:21:45 UTC

[GitHub] [ozone] prashantpogde commented on a change in pull request #2059: HDDS-4945. Initial prototype for MultiTenant support for Ozone.

prashantpogde commented on a change in pull request #2059:
URL: https://github.com/apache/ozone/pull/2059#discussion_r602006764



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/multitenant/AccountNameSpace.java
##########
@@ -0,0 +1,21 @@
+package org.apache.hadoop.ozone.om.multitenant;
+
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+
+@InterfaceAudience.LimitedPrivate({"HDFS", "Yarn", "Ranger", "Hive", "HBase"})
+@InterfaceStability.Evolving
+
+public interface AccountNameSpace {

Review comment:
       done

##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/multitenant/BucketNameSpace.java
##########
@@ -0,0 +1,37 @@
+package org.apache.hadoop.ozone.om.multitenant;
+
+import java.util.List;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+import org.apache.hadoop.ozone.security.acl.OzoneObj;
+
+@InterfaceAudience.LimitedPrivate({"HDFS", "Yarn", "Ranger", "Hive", "HBase"})
+@InterfaceStability.Evolving
+public interface BucketNameSpace {

Review comment:
       done

##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/multitenant/AccessPolicy.java
##########
@@ -0,0 +1,32 @@
+/**
+ * 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.multitenant;
+
+import java.security.Principal;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+
+@InterfaceAudience.LimitedPrivate({"HDFS", "Yarn", "Ranger", "Hive", "HBase"})
+@InterfaceStability.Evolving
+public interface AccessPolicy {
+
+  void createPolicy(String policyJsonString);

Review comment:
       Done

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java
##########
@@ -0,0 +1,237 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.ozone.om.multitenant.AccessPolicy;
+import org.apache.hadoop.ozone.om.multitenant.AccountNameSpace;
+import org.apache.hadoop.ozone.om.multitenant.BucketNameSpace;
+import org.apache.hadoop.ozone.om.multitenant.OzoneMultiTenantPrincipal;
+import org.apache.hadoop.ozone.om.multitenant.Tenant;
+
+import javafx.util.Pair;
+
+/**
+ * OM MultiTenant manager interface.
+ */
+public interface OMMultiTenantManager {
+  /**
+   * Start multi-tenant manager. Performs initialization e.g.
+   *  - Initialize Multi-Tenant-Gatekeeper-Plugin
+   *  - Validate Multi-Tenant Bucket-NameSpaces
+   *  - Validate Multi-Tenant Account-NameSpaces
+   *  - Validating various OM (Multi-Tenant state)tables and corresponding
+   *    state in IMultiTenantGateKeeperPlugin (Ranger/Native/AnyOtherPlugIn).
+   *  - Setup SuperUsers for Multi-Tenant environment from Ozone-Conf
+   *  - Periodic BackGround thread to keep MultiTenant-State consistent e.g.
+   *       . superusers  <-in-sync-> OzoneConf,
+   *       . OM-DB state <-in-sync-> IMultiTenantGateKeeperPluginState
+   *       . OM DB state is always the source of truth.
+   *
+   * @param configuration
+   * @throws IOException
+   */
+  void start(OzoneConfiguration configuration) throws IOException;
+
+  /**
+   * Stop multi-tenant manager.
+   */
+  void stop() throws Exception;
+
+  /**
+   * Returns the corresponding OzoneManager instance.
+   *
+   * @return OMMetadataManager
+   */
+  OMMetadataManager getOzoneManager();
+
+  /**
+   * Given a TenantID String, Create and return Tenant Interface.
+   *
+   * @param tenantID
+   * @return Tenant interface.
+   */
+  Tenant createTenant(String tenantID) throws IOException;

Review comment:
       done.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java
##########
@@ -0,0 +1,237 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.ozone.om.multitenant.AccessPolicy;
+import org.apache.hadoop.ozone.om.multitenant.AccountNameSpace;
+import org.apache.hadoop.ozone.om.multitenant.BucketNameSpace;
+import org.apache.hadoop.ozone.om.multitenant.OzoneMultiTenantPrincipal;
+import org.apache.hadoop.ozone.om.multitenant.Tenant;
+
+import javafx.util.Pair;
+
+/**
+ * OM MultiTenant manager interface.
+ */
+public interface OMMultiTenantManager {
+  /**
+   * Start multi-tenant manager. Performs initialization e.g.
+   *  - Initialize Multi-Tenant-Gatekeeper-Plugin
+   *  - Validate Multi-Tenant Bucket-NameSpaces
+   *  - Validate Multi-Tenant Account-NameSpaces
+   *  - Validating various OM (Multi-Tenant state)tables and corresponding
+   *    state in IMultiTenantGateKeeperPlugin (Ranger/Native/AnyOtherPlugIn).
+   *  - Setup SuperUsers for Multi-Tenant environment from Ozone-Conf
+   *  - Periodic BackGround thread to keep MultiTenant-State consistent e.g.
+   *       . superusers  <-in-sync-> OzoneConf,
+   *       . OM-DB state <-in-sync-> IMultiTenantGateKeeperPluginState
+   *       . OM DB state is always the source of truth.
+   *
+   * @param configuration
+   * @throws IOException
+   */
+  void start(OzoneConfiguration configuration) throws IOException;
+
+  /**
+   * Stop multi-tenant manager.
+   */
+  void stop() throws Exception;
+
+  /**
+   * Returns the corresponding OzoneManager instance.
+   *
+   * @return OMMetadataManager
+   */
+  OMMetadataManager getOzoneManager();

Review comment:
       done




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