diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index ed6d3d80e3..5954bb9757 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -3205,6 +3205,10 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal HIVE_SERVER2_TEZ_INTERACTIVE_QUEUE("hive.server2.tez.interactive.queue", "", "A single YARN queues to use for Hive Interactive sessions. When this is specified,\n" + "workload management is enabled and used for these sessions."), + HIVE_SERVER2_WM_NAMESPACE("hive.server2.wm.namespace", "default", + "The WM namespace to use when one metastore is used by multiple compute clusters each \n" + + "with their own workload management. The special value 'default' (the default) will \n" + + "also include any resource plans created before the namespaces were introduced."), HIVE_SERVER2_WM_WORKER_THREADS("hive.server2.wm.worker.threads", 4, "Number of worker threads to use to perform the synchronous operations with Tez\n" + "sessions for workload management (e.g. opening, closing, etc.)"), diff --git itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java index c3e1e8e88c..d9fb645858 100644 --- itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java +++ itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java @@ -1105,36 +1105,36 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFrom, int } @Override - public WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectException, MetaException { - return objectStore.getResourcePlan(name); + public WMFullResourcePlan getResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { + return objectStore.getResourcePlan(name, ns); } @Override - public List getAllResourcePlans() throws MetaException { - return objectStore.getAllResourcePlans(); + public List getAllResourcePlans(String ns) throws MetaException { + return objectStore.getAllResourcePlans(ns); } @Override - public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan resourcePlan, + public WMFullResourcePlan alterResourcePlan(String name, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { - return objectStore.alterResourcePlan(name, resourcePlan, canActivateDisabled, canDeactivate, isReplace); + return objectStore.alterResourcePlan(name, ns, resourcePlan, canActivateDisabled, canDeactivate, isReplace); } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException { - return objectStore.getActiveResourcePlan(); + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException { + return objectStore.getActiveResourcePlan(ns); } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String name) + public WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException { - return objectStore.validateResourcePlan(name); + return objectStore.validateResourcePlan(name, ns); } @Override - public void dropResourcePlan(String name) throws NoSuchObjectException, MetaException { - objectStore.dropResourcePlan(name); + public void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { + objectStore.dropResourcePlan(name, ns); } @Override @@ -1151,15 +1151,15 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMTrigger(resourcePlanName, triggerName); + objectStore.dropWMTrigger(resourcePlanName, triggerName, ns); } @Override - public List getTriggersForResourcePlan(String resourcePlanName) + public List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException { - return objectStore.getTriggersForResourcePlan(resourcePlanName); + return objectStore.getTriggersForResourcePlan(resourcePlanName, ns); } @Override @@ -1175,9 +1175,9 @@ public void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExists } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMPool(resourcePlanName, poolPath); + objectStore.dropWMPool(resourcePlanName, poolPath, ns); } @Override @@ -1195,15 +1195,15 @@ public void dropWMMapping(WMMapping mapping) @Override public void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + objectStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } @Override public void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { + objectStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } @Override diff --git metastore/scripts/upgrade/hive/hive-schema-4.0.0.hive.sql metastore/scripts/upgrade/hive/hive-schema-4.0.0.hive.sql index a69046f961..9d6bec0243 100644 --- metastore/scripts/upgrade/hive/hive-schema-4.0.0.hive.sql +++ metastore/scripts/upgrade/hive/hive-schema-4.0.0.hive.sql @@ -941,6 +941,7 @@ FROM `PARTITION_PARAMS` GROUP BY `PART_ID`; CREATE EXTERNAL TABLE IF NOT EXISTS `WM_RESOURCEPLANS` ( `NAME` string, + `NS` string, `STATUS` string, `QUERY_PARALLELISM` int, `DEFAULT_POOL_PATH` string @@ -951,6 +952,7 @@ TBLPROPERTIES ( "hive.sql.query" = "SELECT \"WM_RESOURCEPLAN\".\"NAME\", + case when \"WM_RESOURCEPLAN\".\"NS\" is null then 'default' else \"WM_RESOURCEPLAN\".\"NS\" end, \"STATUS\", \"WM_RESOURCEPLAN\".\"QUERY_PARALLELISM\", \"WM_POOL\".\"PATH\" diff --git metastore/scripts/upgrade/hive/upgrade-3.1.0-to-4.0.0.hive.sql metastore/scripts/upgrade/hive/upgrade-3.1.0-to-4.0.0.hive.sql index 4c770206fe..70f093a4ad 100644 --- metastore/scripts/upgrade/hive/upgrade-3.1.0-to-4.0.0.hive.sql +++ metastore/scripts/upgrade/hive/upgrade-3.1.0-to-4.0.0.hive.sql @@ -2,6 +2,31 @@ SELECT 'Upgrading MetaStore schema from 3.1.0 to 4.0.0'; USE SYS; +-- HIVE-20793 +DROP TABLE IF EXISTS `WM_RESOURCEPLANS`; +CREATE EXTERNAL TABLE IF NOT EXISTS `WM_RESOURCEPLANS` ( + `NAME` string, + `NS` string, + `STATUS` string, + `QUERY_PARALLELISM` int, + `DEFAULT_POOL_PATH` string +) +STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( +"hive.sql.database.type" = "METASTORE", +"hive.sql.query" = +"SELECT + \"WM_RESOURCEPLAN\".\"NAME\", + case when \"WM_RESOURCEPLAN\".\"NS\" is null then 'default' else \"WM_RESOURCEPLAN\".\"NS\" end, + \"STATUS\", + \"WM_RESOURCEPLAN\".\"QUERY_PARALLELISM\", + \"WM_POOL\".\"PATH\" +FROM + \"WM_RESOURCEPLAN\" LEFT OUTER JOIN \"WM_POOL\" ON \"WM_RESOURCEPLAN\".\"DEFAULT_POOL_ID\" = \"WM_POOL\".\"POOL_ID\"" +); + + + DROP TABLE IF EXISTS `VERSION`; CREATE OR REPLACE VIEW `VERSION` AS SELECT 1 AS `VER_ID`, '4.0.0' AS `SCHEMA_VERSION`, diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 807f159daa..8eb9ebe607 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -695,6 +695,11 @@ private int showResourcePlans(Hive db, ShowResourcePlanDesc showResourcePlanDesc return 0; } + // Note: the resource plan operations are going to be annotated with namespace based on the config + // inside Hive.java. We don't want HS2 to be aware of namespaces beyond that, or to even see + // that there exist other namespaces, because one HS2 always operates inside just one and we + // don't want this complexity to bleed everywhere. Therefore, this code doesn't care about + // namespaces - Hive.java will transparently scope everything. That's the idea anyway. private int alterResourcePlan(Hive db, AlterResourcePlanDesc desc) throws HiveException { if (desc.shouldValidate()) { WMValidateResourcePlanResponse result = db.validateResourcePlan(desc.getResourcePlanName()); diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 4de038913a..a161426ae3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -5444,9 +5444,15 @@ public void addCheckConstraint(List checkConstraints) } } - public void createResourcePlan(WMResourcePlan resourcePlan, String copyFromName, boolean ifNotExists) throws HiveException { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (resourcePlan.isSetNs() && !ns.equals(resourcePlan.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + resourcePlan.getNs() + ", configured " + ns); + } + resourcePlan.setNs(ns); + try { getMSC().createResourcePlan(resourcePlan, copyFromName); } catch (AlreadyExistsException e) { @@ -5460,7 +5466,7 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFromName, public WMFullResourcePlan getResourcePlan(String rpName) throws HiveException { try { - return getMSC().getResourcePlan(rpName); + return getMSC().getResourcePlan(rpName, conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE)); } catch (NoSuchObjectException e) { return null; } catch (Exception e) { @@ -5470,7 +5476,7 @@ public WMFullResourcePlan getResourcePlan(String rpName) throws HiveException { public List getAllResourcePlans() throws HiveException { try { - return getMSC().getAllResourcePlans(); + return getMSC().getAllResourcePlans(conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE)); } catch (Exception e) { throw new HiveException(e); } @@ -5478,7 +5484,8 @@ public WMFullResourcePlan getResourcePlan(String rpName) throws HiveException { public void dropResourcePlan(String rpName, boolean ifExists) throws HiveException { try { - getMSC().dropResourcePlan(rpName); + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + getMSC().dropResourcePlan(rpName, ns); } catch (NoSuchObjectException e) { if (!ifExists) { throw new HiveException(e, ErrorMsg.RESOURCE_PLAN_NOT_EXISTS, rpName); @@ -5491,7 +5498,13 @@ public void dropResourcePlan(String rpName, boolean ifExists) throws HiveExcepti public WMFullResourcePlan alterResourcePlan(String rpName, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean isForceDeactivate, boolean isReplace) throws HiveException { try { - return getMSC().alterResourcePlan(rpName, resourcePlan, canActivateDisabled, + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (resourcePlan.isSetNs() && !ns.equals(resourcePlan.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + resourcePlan.getNs() + ", configured " + ns); + } + resourcePlan.setNs(ns); + return getMSC().alterResourcePlan(rpName, ns, resourcePlan, canActivateDisabled, isForceDeactivate, isReplace); } catch (Exception e) { throw new HiveException(e); @@ -5500,7 +5513,8 @@ public WMFullResourcePlan alterResourcePlan(String rpName, WMNullableResourcePla public WMFullResourcePlan getActiveResourcePlan() throws HiveException { try { - return getMSC().getActiveResourcePlan(); + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + return getMSC().getActiveResourcePlan(ns); } catch (Exception e) { throw new HiveException(e); } @@ -5508,7 +5522,8 @@ public WMFullResourcePlan getActiveResourcePlan() throws HiveException { public WMValidateResourcePlanResponse validateResourcePlan(String rpName) throws HiveException { try { - return getMSC().validateResourcePlan(rpName); + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + return getMSC().validateResourcePlan(rpName, ns); } catch (Exception e) { throw new HiveException(e); } @@ -5516,6 +5531,12 @@ public WMValidateResourcePlanResponse validateResourcePlan(String rpName) throws public void createWMTrigger(WMTrigger trigger) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (trigger.isSetNs() && !ns.equals(trigger.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + trigger.getNs() + ", configured " + ns); + } + trigger.setNs(ns); getMSC().createWMTrigger(trigger); } catch (Exception e) { throw new HiveException(e); @@ -5524,6 +5545,12 @@ public void createWMTrigger(WMTrigger trigger) throws HiveException { public void alterWMTrigger(WMTrigger trigger) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (trigger.isSetNs() && !ns.equals(trigger.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + trigger.getNs() + ", configured " + ns); + } + trigger.setNs(ns); getMSC().alterWMTrigger(trigger); } catch (Exception e) { throw new HiveException(e); @@ -5532,7 +5559,7 @@ public void alterWMTrigger(WMTrigger trigger) throws HiveException { public void dropWMTrigger(String rpName, String triggerName) throws HiveException { try { - getMSC().dropWMTrigger(rpName, triggerName); + getMSC().dropWMTrigger(rpName, triggerName, conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE)); } catch (Exception e) { throw new HiveException(e); } @@ -5540,6 +5567,12 @@ public void dropWMTrigger(String rpName, String triggerName) throws HiveExceptio public void createWMPool(WMPool pool) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (pool.isSetNs() && !ns.equals(pool.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + pool.getNs() + ", configured " + ns); + } + pool.setNs(ns); getMSC().createWMPool(pool); } catch (Exception e) { throw new HiveException(e); @@ -5548,6 +5581,12 @@ public void createWMPool(WMPool pool) throws HiveException { public void alterWMPool(WMNullablePool pool, String poolPath) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (pool.isSetNs() && !ns.equals(pool.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + pool.getNs() + ", configured " + ns); + } + pool.setNs(ns); getMSC().alterWMPool(pool, poolPath); } catch (Exception e) { throw new HiveException(e); @@ -5556,7 +5595,8 @@ public void alterWMPool(WMNullablePool pool, String poolPath) throws HiveExcepti public void dropWMPool(String resourcePlanName, String poolPath) throws HiveException { try { - getMSC().dropWMPool(resourcePlanName, poolPath); + getMSC().dropWMPool(resourcePlanName, poolPath, + conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE)); } catch (Exception e) { throw new HiveException(e); } @@ -5565,6 +5605,12 @@ public void dropWMPool(String resourcePlanName, String poolPath) throws HiveExce public void createOrUpdateWMMapping(WMMapping mapping, boolean isUpdate) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (mapping.isSetNs() && !ns.equals(mapping.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + mapping.getNs() + ", configured " + ns); + } + mapping.setNs(ns); getMSC().createOrUpdateWMMapping(mapping, isUpdate); } catch (Exception e) { throw new HiveException(e); @@ -5573,17 +5619,24 @@ public void createOrUpdateWMMapping(WMMapping mapping, boolean isUpdate) public void dropWMMapping(WMMapping mapping) throws HiveException { try { + String ns = conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE); + if (mapping.isSetNs() && !ns.equals(mapping.getNs())) { + throw new HiveException("Cannot modify a plan in a different NS; was " + + mapping.getNs() + ", configured " + ns); + } + mapping.setNs(ns); getMSC().dropWMMapping(mapping); } catch (Exception e) { throw new HiveException(e); } } - + // TODO: eh public void createOrDropTriggerToPoolMapping(String resourcePlanName, String triggerName, String poolPath, boolean shouldDrop) throws HiveException { try { - getMSC().createOrDropTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, shouldDrop); + getMSC().createOrDropTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, + shouldDrop, conf.getVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE)); } catch (Exception e) { throw new HiveException(e); } diff --git ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java index e57db935d9..f8c441076f 100755 --- ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java +++ ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java @@ -26,6 +26,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Pattern; import org.apache.hadoop.fs.FileStatus; @@ -37,7 +38,13 @@ import org.apache.hadoop.hive.metastore.Warehouse; import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.metastore.api.WMFullResourcePlan; +import org.apache.hadoop.hive.metastore.api.WMNullableResourcePlan; +import org.apache.hadoop.hive.metastore.api.WMPool; +import org.apache.hadoop.hive.metastore.api.WMResourcePlan; +import org.apache.hadoop.hive.metastore.api.WMResourcePlanStatus; import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants; import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat; import org.apache.hadoop.hive.ql.session.SessionState; @@ -59,8 +66,10 @@ import org.apache.logging.log4j.core.config.LoggerConfig; import org.apache.thrift.protocol.TBinaryProtocol; import org.junit.Assert; +import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; import junit.framework.TestCase; @@ -76,20 +85,21 @@ protected void setUp() throws Exception { super.setUp(); hiveConf = new HiveConf(this.getClass()); - hiveConf - .setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, + hm = setUpImpl(hiveConf); + } + + private static Hive setUpImpl(HiveConf hiveConf) throws Exception { + hiveConf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory"); // enable trash so it can be tested hiveConf.setFloat("fs.trash.checkpoint.interval", 30); // FS_TRASH_CHECKPOINT_INTERVAL_KEY (hadoop-2) hiveConf.setFloat("fs.trash.interval", 30); // FS_TRASH_INTERVAL_KEY (hadoop-2) SessionState.start(hiveConf); try { - hm = Hive.get(hiveConf); + return Hive.get(hiveConf); } catch (Exception e) { System.err.println(StringUtils.stringifyException(e)); - System.err - .println("Unable to initialize Hive Metastore using configuration: \n " - + hiveConf); + System.err.println("Unable to initialize Hive Metastore using configuration: \n" + hiveConf); throw e; } } @@ -421,6 +431,53 @@ public void testGetAndDropTables() throws Throwable { throw e; } } + static final private org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger("WTF"); + public void testWmNamespaceHandling() throws Throwable { + HiveConf hiveConf = new HiveConf(this.getClass()); + Hive hm = setUpImpl(hiveConf); + // TODO: threadlocals... Why is all this Hive client stuff like that?!! + final AtomicReference hm2r = new AtomicReference<>(); + Thread pointlessThread = new Thread(new Runnable() { + @Override + public void run() { + HiveConf hiveConf2 = new HiveConf(this.getClass()); + hiveConf2.setVar(ConfVars.HIVE_SERVER2_WM_NAMESPACE, "hm2"); + try { + hm2r.set(setUpImpl(hiveConf2)); + } catch (Exception e) { + System.err.println(StringUtils.stringifyException(e)); + } + } + }); + pointlessThread.start(); + pointlessThread.join(); + Hive hm2 = hm2r.get(); + assertNotNull(hm2); + + + hm.createResourcePlan(new WMResourcePlan("hm"), null, false); + assertEquals(1, hm.getAllResourcePlans().size()); + assertEquals(0, hm2.getAllResourcePlans().size()); + hm2.createResourcePlan(new WMResourcePlan("hm"), null, false); + WMNullableResourcePlan changes = new WMNullableResourcePlan(); + changes.setStatus(WMResourcePlanStatus.ACTIVE); + hm.alterResourcePlan("hm", changes, true, false, false); + // We should not be able to modify the active plan. + WMPool pool = new WMPool("hm", "foo"); + pool.setAllocFraction(0); + pool.setQueryParallelism(1); + try { + hm.createWMPool(pool); + fail("Expected exception"); + } catch (HiveException e) { + } + // But we should still be able to modify the other plan. + pool.unsetNs(); // The call to create sets the namespace. + hm2.createWMPool(pool); + // Make the 2nd plan active in a different namespace. + changes.unsetNs(); + hm2.alterResourcePlan("hm", changes, true, false, false); + } public void testDropTableTrash() throws Throwable { if (!ShimLoader.getHadoopShims().supportTrashFeature()) { diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMAlterResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMAlterResourcePlanRequest.java index 412400141a..46882ecec4 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMAlterResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMAlterResourcePlanRequest.java @@ -43,6 +43,7 @@ private static final org.apache.thrift.protocol.TField IS_ENABLE_AND_ACTIVATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isEnableAndActivate", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField IS_FORCE_DEACTIVATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isForceDeactivate", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField IS_REPLACE_FIELD_DESC = new org.apache.thrift.protocol.TField("isReplace", org.apache.thrift.protocol.TType.BOOL, (short)5); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -55,6 +56,7 @@ private boolean isEnableAndActivate; // optional private boolean isForceDeactivate; // optional private boolean isReplace; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +64,8 @@ RESOURCE_PLAN((short)2, "resourcePlan"), IS_ENABLE_AND_ACTIVATE((short)3, "isEnableAndActivate"), IS_FORCE_DEACTIVATE((short)4, "isForceDeactivate"), - IS_REPLACE((short)5, "isReplace"); + IS_REPLACE((short)5, "isReplace"), + NS((short)6, "ns"); private static final Map byName = new HashMap(); @@ -87,6 +90,8 @@ public static _Fields findByThriftId(int fieldId) { return IS_FORCE_DEACTIVATE; case 5: // IS_REPLACE return IS_REPLACE; + case 6: // NS + return NS; default: return null; } @@ -131,7 +136,7 @@ public String getFieldName() { private static final int __ISFORCEDEACTIVATE_ISSET_ID = 1; private static final int __ISREPLACE_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.RESOURCE_PLAN,_Fields.IS_ENABLE_AND_ACTIVATE,_Fields.IS_FORCE_DEACTIVATE,_Fields.IS_REPLACE}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.RESOURCE_PLAN,_Fields.IS_ENABLE_AND_ACTIVATE,_Fields.IS_FORCE_DEACTIVATE,_Fields.IS_REPLACE,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -145,6 +150,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.IS_REPLACE, new org.apache.thrift.meta_data.FieldMetaData("isReplace", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMAlterResourcePlanRequest.class, metaDataMap); } @@ -166,6 +173,9 @@ public WMAlterResourcePlanRequest(WMAlterResourcePlanRequest other) { this.isEnableAndActivate = other.isEnableAndActivate; this.isForceDeactivate = other.isForceDeactivate; this.isReplace = other.isReplace; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMAlterResourcePlanRequest deepCopy() { @@ -182,6 +192,7 @@ public void clear() { this.isForceDeactivate = false; setIsReplaceIsSet(false); this.isReplace = false; + this.ns = null; } public String getResourcePlanName() { @@ -296,6 +307,29 @@ public void setIsReplaceIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISREPLACE_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -338,6 +372,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -358,6 +400,9 @@ public Object getFieldValue(_Fields field) { case IS_REPLACE: return isIsReplace(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -379,6 +424,8 @@ public boolean isSet(_Fields field) { return isSetIsForceDeactivate(); case IS_REPLACE: return isSetIsReplace(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -441,6 +488,15 @@ public boolean equals(WMAlterResourcePlanRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -473,6 +529,11 @@ public int hashCode() { if (present_isReplace) list.add(isReplace); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -534,6 +595,16 @@ public int compareTo(WMAlterResourcePlanRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -591,6 +662,16 @@ public String toString() { sb.append(this.isReplace); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -680,6 +761,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMAlterResourcePlan org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -722,6 +811,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMAlterResourcePla oprot.writeBool(struct.isReplace); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -755,7 +851,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMAlterResourcePlan if (struct.isSetIsReplace()) { optionals.set(4); } - oprot.writeBitSet(optionals, 5); + if (struct.isSetNs()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } @@ -771,12 +870,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMAlterResourcePlan if (struct.isSetIsReplace()) { oprot.writeBool(struct.isReplace); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMAlterResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); + BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); @@ -798,6 +900,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMAlterResourcePlanR struct.isReplace = iprot.readBool(); struct.setIsReplaceIsSet(true); } + if (incoming.get(5)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMCreateOrDropTriggerToPoolMappingRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMCreateOrDropTriggerToPoolMappingRequest.java index f807be9854..1fc94d687d 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMCreateOrDropTriggerToPoolMappingRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMCreateOrDropTriggerToPoolMappingRequest.java @@ -42,6 +42,7 @@ private static final org.apache.thrift.protocol.TField TRIGGER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("triggerName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("poolPath", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField DROP_FIELD_DESC = new org.apache.thrift.protocol.TField("drop", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)5); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -53,13 +54,15 @@ private String triggerName; // optional private String poolPath; // optional private boolean drop; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), TRIGGER_NAME((short)2, "triggerName"), POOL_PATH((short)3, "poolPath"), - DROP((short)4, "drop"); + DROP((short)4, "drop"), + NS((short)5, "ns"); private static final Map byName = new HashMap(); @@ -82,6 +85,8 @@ public static _Fields findByThriftId(int fieldId) { return POOL_PATH; case 4: // DROP return DROP; + case 5: // NS + return NS; default: return null; } @@ -124,7 +129,7 @@ public String getFieldName() { // isset id assignments private static final int __DROP_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.TRIGGER_NAME,_Fields.POOL_PATH,_Fields.DROP}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.TRIGGER_NAME,_Fields.POOL_PATH,_Fields.DROP,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -136,6 +141,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DROP, new org.apache.thrift.meta_data.FieldMetaData("drop", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMCreateOrDropTriggerToPoolMappingRequest.class, metaDataMap); } @@ -158,6 +165,9 @@ public WMCreateOrDropTriggerToPoolMappingRequest(WMCreateOrDropTriggerToPoolMapp this.poolPath = other.poolPath; } this.drop = other.drop; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMCreateOrDropTriggerToPoolMappingRequest deepCopy() { @@ -171,6 +181,7 @@ public void clear() { this.poolPath = null; setDropIsSet(false); this.drop = false; + this.ns = null; } public String getResourcePlanName() { @@ -264,6 +275,29 @@ public void setDropIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DROP_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -298,6 +332,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -315,6 +357,9 @@ public Object getFieldValue(_Fields field) { case DROP: return isDrop(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -334,6 +379,8 @@ public boolean isSet(_Fields field) { return isSetPoolPath(); case DROP: return isSetDrop(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -387,6 +434,15 @@ public boolean equals(WMCreateOrDropTriggerToPoolMappingRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -414,6 +470,11 @@ public int hashCode() { if (present_drop) list.add(drop); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -465,6 +526,16 @@ public int compareTo(WMCreateOrDropTriggerToPoolMappingRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -520,6 +591,16 @@ public String toString() { sb.append(this.drop); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -597,6 +678,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMCreateOrDropTrigg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -636,6 +725,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMCreateOrDropTrig oprot.writeBool(struct.drop); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -666,7 +762,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMCreateOrDropTrigg if (struct.isSetDrop()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetNs()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } @@ -679,12 +778,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMCreateOrDropTrigg if (struct.isSetDrop()) { oprot.writeBool(struct.drop); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMCreateOrDropTriggerToPoolMappingRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); @@ -701,6 +803,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMCreateOrDropTrigge struct.drop = iprot.readBool(); struct.setDropIsSet(true); } + if (incoming.get(4)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropPoolRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropPoolRequest.java index 114cdde46a..555bc5d16a 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropPoolRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropPoolRequest.java @@ -40,6 +40,7 @@ private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("poolPath", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +50,13 @@ private String resourcePlanName; // optional private String poolPath; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), - POOL_PATH((short)2, "poolPath"); + POOL_PATH((short)2, "poolPath"), + NS((short)3, "ns"); private static final Map byName = new HashMap(); @@ -72,6 +75,8 @@ public static _Fields findByThriftId(int fieldId) { return RESOURCE_PLAN_NAME; case 2: // POOL_PATH return POOL_PATH; + case 3: // NS + return NS; default: return null; } @@ -112,7 +117,7 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.POOL_PATH}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.POOL_PATH,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -120,6 +125,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.POOL_PATH, new org.apache.thrift.meta_data.FieldMetaData("poolPath", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMDropPoolRequest.class, metaDataMap); } @@ -137,6 +144,9 @@ public WMDropPoolRequest(WMDropPoolRequest other) { if (other.isSetPoolPath()) { this.poolPath = other.poolPath; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMDropPoolRequest deepCopy() { @@ -147,6 +157,7 @@ public WMDropPoolRequest deepCopy() { public void clear() { this.resourcePlanName = null; this.poolPath = null; + this.ns = null; } public String getResourcePlanName() { @@ -195,6 +206,29 @@ public void setPoolPathIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -213,6 +247,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -224,6 +266,9 @@ public Object getFieldValue(_Fields field) { case POOL_PATH: return getPoolPath(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -239,6 +284,8 @@ public boolean isSet(_Fields field) { return isSetResourcePlanName(); case POOL_PATH: return isSetPoolPath(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -274,6 +321,15 @@ public boolean equals(WMDropPoolRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -291,6 +347,11 @@ public int hashCode() { if (present_poolPath) list.add(poolPath); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -322,6 +383,16 @@ public int compareTo(WMDropPoolRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -361,6 +432,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -420,6 +501,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMDropPoolRequest s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -447,6 +536,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMDropPoolRequest oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -471,19 +567,25 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMDropPoolRequest s if (struct.isSetPoolPath()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetNs()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } if (struct.isSetPoolPath()) { oprot.writeString(struct.poolPath); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMDropPoolRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); @@ -492,6 +594,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMDropPoolRequest st struct.poolPath = iprot.readString(); struct.setPoolPathIsSet(true); } + if (incoming.get(2)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropResourcePlanRequest.java index 779b2d1e61..49036d2b04 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropResourcePlanRequest.java @@ -39,6 +39,7 @@ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMDropResourcePlanRequest"); private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -47,10 +48,12 @@ } private String resourcePlanName; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - RESOURCE_PLAN_NAME((short)1, "resourcePlanName"); + RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), + NS((short)2, "ns"); private static final Map byName = new HashMap(); @@ -67,6 +70,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RESOURCE_PLAN_NAME return RESOURCE_PLAN_NAME; + case 2: // NS + return NS; default: return null; } @@ -107,12 +112,14 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESOURCE_PLAN_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourcePlanName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMDropResourcePlanRequest.class, metaDataMap); } @@ -127,6 +134,9 @@ public WMDropResourcePlanRequest(WMDropResourcePlanRequest other) { if (other.isSetResourcePlanName()) { this.resourcePlanName = other.resourcePlanName; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMDropResourcePlanRequest deepCopy() { @@ -136,6 +146,7 @@ public WMDropResourcePlanRequest deepCopy() { @Override public void clear() { this.resourcePlanName = null; + this.ns = null; } public String getResourcePlanName() { @@ -161,6 +172,29 @@ public void setResourcePlanNameIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -171,6 +205,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -179,6 +221,9 @@ public Object getFieldValue(_Fields field) { case RESOURCE_PLAN_NAME: return getResourcePlanName(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -192,6 +237,8 @@ public boolean isSet(_Fields field) { switch (field) { case RESOURCE_PLAN_NAME: return isSetResourcePlanName(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -218,6 +265,15 @@ public boolean equals(WMDropResourcePlanRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -230,6 +286,11 @@ public int hashCode() { if (present_resourcePlanName) list.add(resourcePlanName); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -251,6 +312,16 @@ public int compareTo(WMDropResourcePlanRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -280,6 +351,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -331,6 +412,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMDropResourcePlanR org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -351,6 +440,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMDropResourcePlan oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -372,20 +468,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMDropResourcePlanR if (struct.isSetResourcePlanName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMDropResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); } + if (incoming.get(1)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropTriggerRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropTriggerRequest.java index 9cde38d49b..5122b243f5 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropTriggerRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMDropTriggerRequest.java @@ -40,6 +40,7 @@ private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TRIGGER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("triggerName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +50,13 @@ private String resourcePlanName; // optional private String triggerName; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), - TRIGGER_NAME((short)2, "triggerName"); + TRIGGER_NAME((short)2, "triggerName"), + NS((short)3, "ns"); private static final Map byName = new HashMap(); @@ -72,6 +75,8 @@ public static _Fields findByThriftId(int fieldId) { return RESOURCE_PLAN_NAME; case 2: // TRIGGER_NAME return TRIGGER_NAME; + case 3: // NS + return NS; default: return null; } @@ -112,7 +117,7 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.TRIGGER_NAME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.TRIGGER_NAME,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -120,6 +125,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TRIGGER_NAME, new org.apache.thrift.meta_data.FieldMetaData("triggerName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMDropTriggerRequest.class, metaDataMap); } @@ -137,6 +144,9 @@ public WMDropTriggerRequest(WMDropTriggerRequest other) { if (other.isSetTriggerName()) { this.triggerName = other.triggerName; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMDropTriggerRequest deepCopy() { @@ -147,6 +157,7 @@ public WMDropTriggerRequest deepCopy() { public void clear() { this.resourcePlanName = null; this.triggerName = null; + this.ns = null; } public String getResourcePlanName() { @@ -195,6 +206,29 @@ public void setTriggerNameIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -213,6 +247,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -224,6 +266,9 @@ public Object getFieldValue(_Fields field) { case TRIGGER_NAME: return getTriggerName(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -239,6 +284,8 @@ public boolean isSet(_Fields field) { return isSetResourcePlanName(); case TRIGGER_NAME: return isSetTriggerName(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -274,6 +321,15 @@ public boolean equals(WMDropTriggerRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -291,6 +347,11 @@ public int hashCode() { if (present_triggerName) list.add(triggerName); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -322,6 +383,16 @@ public int compareTo(WMDropTriggerRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -361,6 +432,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -420,6 +501,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMDropTriggerReques org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -447,6 +536,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMDropTriggerReque oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -471,19 +567,25 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMDropTriggerReques if (struct.isSetTriggerName()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetNs()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } if (struct.isSetTriggerName()) { oprot.writeString(struct.triggerName); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMDropTriggerRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); @@ -492,6 +594,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMDropTriggerRequest struct.triggerName = iprot.readString(); struct.setTriggerNameIsSet(true); } + if (incoming.get(2)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetActiveResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetActiveResourcePlanRequest.java index ec2a1f513e..50efd069dc 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetActiveResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetActiveResourcePlanRequest.java @@ -38,6 +38,7 @@ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class WMGetActiveResourcePlanRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMGetActiveResourcePlanRequest"); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -45,10 +46,11 @@ schemes.put(TupleScheme.class, new WMGetActiveResourcePlanRequestTupleSchemeFactory()); } + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; + NS((short)1, "ns"); private static final Map byName = new HashMap(); @@ -63,6 +65,8 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // NS + return NS; default: return null; } @@ -101,9 +105,14 @@ public String getFieldName() { return _fieldName; } } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMGetActiveResourcePlanRequest.class, metaDataMap); } @@ -115,6 +124,9 @@ public WMGetActiveResourcePlanRequest() { * Performs a deep copy on other. */ public WMGetActiveResourcePlanRequest(WMGetActiveResourcePlanRequest other) { + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMGetActiveResourcePlanRequest deepCopy() { @@ -123,15 +135,50 @@ public WMGetActiveResourcePlanRequest deepCopy() { @Override public void clear() { + this.ns = null; + } + + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } public Object getFieldValue(_Fields field) { switch (field) { + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -143,6 +190,8 @@ public boolean isSet(_Fields field) { } switch (field) { + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -160,6 +209,15 @@ public boolean equals(WMGetActiveResourcePlanRequest that) { if (that == null) return false; + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -167,6 +225,11 @@ public boolean equals(WMGetActiveResourcePlanRequest that) { public int hashCode() { List list = new ArrayList(); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -178,6 +241,16 @@ public int compareTo(WMGetActiveResourcePlanRequest other) { int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -198,6 +271,15 @@ public String toString() { StringBuilder sb = new StringBuilder("WMGetActiveResourcePlanRequest("); boolean first = true; + if (isSetNs()) { + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -241,6 +323,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMGetActiveResource break; } switch (schemeField.id) { + case 1: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -254,6 +344,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMGetActiveResourc struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -271,11 +368,24 @@ public WMGetActiveResourcePlanRequestTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, WMGetActiveResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetNs()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMGetActiveResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetAllResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetAllResourcePlanRequest.java index 3df8610c90..7efdb187c8 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetAllResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetAllResourcePlanRequest.java @@ -38,6 +38,7 @@ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class WMGetAllResourcePlanRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMGetAllResourcePlanRequest"); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -45,10 +46,11 @@ schemes.put(TupleScheme.class, new WMGetAllResourcePlanRequestTupleSchemeFactory()); } + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; + NS((short)1, "ns"); private static final Map byName = new HashMap(); @@ -63,6 +65,8 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // NS + return NS; default: return null; } @@ -101,9 +105,14 @@ public String getFieldName() { return _fieldName; } } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMGetAllResourcePlanRequest.class, metaDataMap); } @@ -115,6 +124,9 @@ public WMGetAllResourcePlanRequest() { * Performs a deep copy on other. */ public WMGetAllResourcePlanRequest(WMGetAllResourcePlanRequest other) { + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMGetAllResourcePlanRequest deepCopy() { @@ -123,15 +135,50 @@ public WMGetAllResourcePlanRequest deepCopy() { @Override public void clear() { + this.ns = null; + } + + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } public Object getFieldValue(_Fields field) { switch (field) { + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -143,6 +190,8 @@ public boolean isSet(_Fields field) { } switch (field) { + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -160,6 +209,15 @@ public boolean equals(WMGetAllResourcePlanRequest that) { if (that == null) return false; + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -167,6 +225,11 @@ public boolean equals(WMGetAllResourcePlanRequest that) { public int hashCode() { List list = new ArrayList(); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -178,6 +241,16 @@ public int compareTo(WMGetAllResourcePlanRequest other) { int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -198,6 +271,15 @@ public String toString() { StringBuilder sb = new StringBuilder("WMGetAllResourcePlanRequest("); boolean first = true; + if (isSetNs()) { + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -241,6 +323,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMGetAllResourcePla break; } switch (schemeField.id) { + case 1: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -254,6 +344,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMGetAllResourcePl struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -271,11 +368,24 @@ public WMGetAllResourcePlanRequestTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, WMGetAllResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetNs()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMGetAllResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetResourcePlanRequest.java index d051634a40..00139dc59a 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetResourcePlanRequest.java @@ -39,6 +39,7 @@ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMGetResourcePlanRequest"); private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -47,10 +48,12 @@ } private String resourcePlanName; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - RESOURCE_PLAN_NAME((short)1, "resourcePlanName"); + RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), + NS((short)2, "ns"); private static final Map byName = new HashMap(); @@ -67,6 +70,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RESOURCE_PLAN_NAME return RESOURCE_PLAN_NAME; + case 2: // NS + return NS; default: return null; } @@ -107,12 +112,14 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESOURCE_PLAN_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourcePlanName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMGetResourcePlanRequest.class, metaDataMap); } @@ -127,6 +134,9 @@ public WMGetResourcePlanRequest(WMGetResourcePlanRequest other) { if (other.isSetResourcePlanName()) { this.resourcePlanName = other.resourcePlanName; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMGetResourcePlanRequest deepCopy() { @@ -136,6 +146,7 @@ public WMGetResourcePlanRequest deepCopy() { @Override public void clear() { this.resourcePlanName = null; + this.ns = null; } public String getResourcePlanName() { @@ -161,6 +172,29 @@ public void setResourcePlanNameIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -171,6 +205,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -179,6 +221,9 @@ public Object getFieldValue(_Fields field) { case RESOURCE_PLAN_NAME: return getResourcePlanName(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -192,6 +237,8 @@ public boolean isSet(_Fields field) { switch (field) { case RESOURCE_PLAN_NAME: return isSetResourcePlanName(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -218,6 +265,15 @@ public boolean equals(WMGetResourcePlanRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -230,6 +286,11 @@ public int hashCode() { if (present_resourcePlanName) list.add(resourcePlanName); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -251,6 +312,16 @@ public int compareTo(WMGetResourcePlanRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -280,6 +351,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -331,6 +412,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMGetResourcePlanRe org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -351,6 +440,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMGetResourcePlanR oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -372,20 +468,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMGetResourcePlanRe if (struct.isSetResourcePlanName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMGetResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); } + if (incoming.get(1)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetTriggersForResourePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetTriggersForResourePlanRequest.java index ce64a0414c..2fac911032 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetTriggersForResourePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMGetTriggersForResourePlanRequest.java @@ -39,6 +39,7 @@ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMGetTriggersForResourePlanRequest"); private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -47,10 +48,12 @@ } private String resourcePlanName; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - RESOURCE_PLAN_NAME((short)1, "resourcePlanName"); + RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), + NS((short)2, "ns"); private static final Map byName = new HashMap(); @@ -67,6 +70,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RESOURCE_PLAN_NAME return RESOURCE_PLAN_NAME; + case 2: // NS + return NS; default: return null; } @@ -107,12 +112,14 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESOURCE_PLAN_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourcePlanName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMGetTriggersForResourePlanRequest.class, metaDataMap); } @@ -127,6 +134,9 @@ public WMGetTriggersForResourePlanRequest(WMGetTriggersForResourePlanRequest oth if (other.isSetResourcePlanName()) { this.resourcePlanName = other.resourcePlanName; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMGetTriggersForResourePlanRequest deepCopy() { @@ -136,6 +146,7 @@ public WMGetTriggersForResourePlanRequest deepCopy() { @Override public void clear() { this.resourcePlanName = null; + this.ns = null; } public String getResourcePlanName() { @@ -161,6 +172,29 @@ public void setResourcePlanNameIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -171,6 +205,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -179,6 +221,9 @@ public Object getFieldValue(_Fields field) { case RESOURCE_PLAN_NAME: return getResourcePlanName(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -192,6 +237,8 @@ public boolean isSet(_Fields field) { switch (field) { case RESOURCE_PLAN_NAME: return isSetResourcePlanName(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -218,6 +265,15 @@ public boolean equals(WMGetTriggersForResourePlanRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -230,6 +286,11 @@ public int hashCode() { if (present_resourcePlanName) list.add(resourcePlanName); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -251,6 +312,16 @@ public int compareTo(WMGetTriggersForResourePlanRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -280,6 +351,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -331,6 +412,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMGetTriggersForRes org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -351,6 +440,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMGetTriggersForRe oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -372,20 +468,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMGetTriggersForRes if (struct.isSetResourcePlanName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMGetTriggersForResourePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); } + if (incoming.get(1)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMMapping.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMMapping.java index 8b7d41a85f..8be0441412 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMMapping.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMMapping.java @@ -43,6 +43,7 @@ private static final org.apache.thrift.protocol.TField ENTITY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("entityName", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("poolPath", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField ORDERING_FIELD_DESC = new org.apache.thrift.protocol.TField("ordering", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -55,6 +56,7 @@ private String entityName; // required private String poolPath; // optional private int ordering; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +64,8 @@ ENTITY_TYPE((short)2, "entityType"), ENTITY_NAME((short)3, "entityName"), POOL_PATH((short)4, "poolPath"), - ORDERING((short)5, "ordering"); + ORDERING((short)5, "ordering"), + NS((short)6, "ns"); private static final Map byName = new HashMap(); @@ -87,6 +90,8 @@ public static _Fields findByThriftId(int fieldId) { return POOL_PATH; case 5: // ORDERING return ORDERING; + case 6: // NS + return NS; default: return null; } @@ -129,7 +134,7 @@ public String getFieldName() { // isset id assignments private static final int __ORDERING_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.POOL_PATH,_Fields.ORDERING}; + private static final _Fields optionals[] = {_Fields.POOL_PATH,_Fields.ORDERING,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -143,6 +148,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ORDERING, new org.apache.thrift.meta_data.FieldMetaData("ordering", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMMapping.class, metaDataMap); } @@ -179,6 +186,9 @@ public WMMapping(WMMapping other) { this.poolPath = other.poolPath; } this.ordering = other.ordering; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMMapping deepCopy() { @@ -193,6 +203,7 @@ public void clear() { this.poolPath = null; setOrderingIsSet(false); this.ordering = 0; + this.ns = null; } public String getResourcePlanName() { @@ -309,6 +320,29 @@ public void setOrderingIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ORDERING_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -351,6 +385,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -371,6 +413,9 @@ public Object getFieldValue(_Fields field) { case ORDERING: return getOrdering(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -392,6 +437,8 @@ public boolean isSet(_Fields field) { return isSetPoolPath(); case ORDERING: return isSetOrdering(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -454,6 +501,15 @@ public boolean equals(WMMapping that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -486,6 +542,11 @@ public int hashCode() { if (present_ordering) list.add(ordering); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -547,6 +608,16 @@ public int compareTo(WMMapping other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -606,6 +677,16 @@ public String toString() { sb.append(this.ordering); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -703,6 +784,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMMapping struct) t org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -743,6 +832,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMMapping struct) oprot.writeI32(struct.ordering); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -770,13 +866,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMMapping struct) t if (struct.isSetOrdering()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetNs()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetPoolPath()) { oprot.writeString(struct.poolPath); } if (struct.isSetOrdering()) { oprot.writeI32(struct.ordering); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -788,7 +890,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMMapping struct) th struct.setEntityTypeIsSet(true); struct.entityName = iprot.readString(); struct.setEntityNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.poolPath = iprot.readString(); struct.setPoolPathIsSet(true); @@ -797,6 +899,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMMapping struct) th struct.ordering = iprot.readI32(); struct.setOrderingIsSet(true); } + if (incoming.get(2)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullablePool.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullablePool.java index 5e3e4032e6..fbf9c19d6a 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullablePool.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullablePool.java @@ -44,6 +44,7 @@ private static final org.apache.thrift.protocol.TField QUERY_PARALLELISM_FIELD_DESC = new org.apache.thrift.protocol.TField("queryParallelism", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField SCHEDULING_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("schedulingPolicy", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField IS_SET_SCHEDULING_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("isSetSchedulingPolicy", org.apache.thrift.protocol.TType.BOOL, (short)6); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)7); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -57,6 +58,7 @@ private int queryParallelism; // optional private String schedulingPolicy; // optional private boolean isSetSchedulingPolicy; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -65,7 +67,8 @@ ALLOC_FRACTION((short)3, "allocFraction"), QUERY_PARALLELISM((short)4, "queryParallelism"), SCHEDULING_POLICY((short)5, "schedulingPolicy"), - IS_SET_SCHEDULING_POLICY((short)6, "isSetSchedulingPolicy"); + IS_SET_SCHEDULING_POLICY((short)6, "isSetSchedulingPolicy"), + NS((short)7, "ns"); private static final Map byName = new HashMap(); @@ -92,6 +95,8 @@ public static _Fields findByThriftId(int fieldId) { return SCHEDULING_POLICY; case 6: // IS_SET_SCHEDULING_POLICY return IS_SET_SCHEDULING_POLICY; + case 7: // NS + return NS; default: return null; } @@ -136,7 +141,7 @@ public String getFieldName() { private static final int __QUERYPARALLELISM_ISSET_ID = 1; private static final int __ISSETSCHEDULINGPOLICY_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.ALLOC_FRACTION,_Fields.QUERY_PARALLELISM,_Fields.SCHEDULING_POLICY,_Fields.IS_SET_SCHEDULING_POLICY}; + private static final _Fields optionals[] = {_Fields.ALLOC_FRACTION,_Fields.QUERY_PARALLELISM,_Fields.SCHEDULING_POLICY,_Fields.IS_SET_SCHEDULING_POLICY,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -152,6 +157,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_SET_SCHEDULING_POLICY, new org.apache.thrift.meta_data.FieldMetaData("isSetSchedulingPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMNullablePool.class, metaDataMap); } @@ -185,6 +192,9 @@ public WMNullablePool(WMNullablePool other) { this.schedulingPolicy = other.schedulingPolicy; } this.isSetSchedulingPolicy = other.isSetSchedulingPolicy; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMNullablePool deepCopy() { @@ -202,6 +212,7 @@ public void clear() { this.schedulingPolicy = null; setIsSetSchedulingPolicyIsSet(false); this.isSetSchedulingPolicy = false; + this.ns = null; } public String getResourcePlanName() { @@ -339,6 +350,29 @@ public void setIsSetSchedulingPolicyIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISSETSCHEDULINGPOLICY_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -389,6 +423,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -412,6 +454,9 @@ public Object getFieldValue(_Fields field) { case IS_SET_SCHEDULING_POLICY: return isIsSetSchedulingPolicy(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -435,6 +480,8 @@ public boolean isSet(_Fields field) { return isSetSchedulingPolicy(); case IS_SET_SCHEDULING_POLICY: return isSetIsSetSchedulingPolicy(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -506,6 +553,15 @@ public boolean equals(WMNullablePool that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -543,6 +599,11 @@ public int hashCode() { if (present_isSetSchedulingPolicy) list.add(isSetSchedulingPolicy); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -614,6 +675,16 @@ public int compareTo(WMNullablePool other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -677,6 +748,16 @@ public String toString() { sb.append(this.isSetSchedulingPolicy); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -778,6 +859,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMNullablePool stru org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 7: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -823,6 +912,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMNullablePool str oprot.writeBool(struct.isSetSchedulingPolicy); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -855,7 +951,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMNullablePool stru if (struct.isSetIsSetSchedulingPolicy()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetNs()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetAllocFraction()) { oprot.writeDouble(struct.allocFraction); } @@ -868,6 +967,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMNullablePool stru if (struct.isSetIsSetSchedulingPolicy()) { oprot.writeBool(struct.isSetSchedulingPolicy); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -877,7 +979,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMNullablePool struc struct.setResourcePlanNameIsSet(true); struct.poolPath = iprot.readString(); struct.setPoolPathIsSet(true); - BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.allocFraction = iprot.readDouble(); struct.setAllocFractionIsSet(true); @@ -894,6 +996,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMNullablePool struc struct.isSetSchedulingPolicy = iprot.readBool(); struct.setIsSetSchedulingPolicyIsSet(true); } + if (incoming.get(4)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullableResourcePlan.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullableResourcePlan.java index 4621e10bdd..15bb764b81 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullableResourcePlan.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMNullableResourcePlan.java @@ -44,6 +44,7 @@ private static final org.apache.thrift.protocol.TField IS_SET_QUERY_PARALLELISM_FIELD_DESC = new org.apache.thrift.protocol.TField("isSetQueryParallelism", org.apache.thrift.protocol.TType.BOOL, (short)5); private static final org.apache.thrift.protocol.TField DEFAULT_POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultPoolPath", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField IS_SET_DEFAULT_POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("isSetDefaultPoolPath", org.apache.thrift.protocol.TType.BOOL, (short)7); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)8); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -57,6 +58,7 @@ private boolean isSetQueryParallelism; // optional private String defaultPoolPath; // optional private boolean isSetDefaultPoolPath; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -69,7 +71,8 @@ QUERY_PARALLELISM((short)4, "queryParallelism"), IS_SET_QUERY_PARALLELISM((short)5, "isSetQueryParallelism"), DEFAULT_POOL_PATH((short)6, "defaultPoolPath"), - IS_SET_DEFAULT_POOL_PATH((short)7, "isSetDefaultPoolPath"); + IS_SET_DEFAULT_POOL_PATH((short)7, "isSetDefaultPoolPath"), + NS((short)8, "ns"); private static final Map byName = new HashMap(); @@ -96,6 +99,8 @@ public static _Fields findByThriftId(int fieldId) { return DEFAULT_POOL_PATH; case 7: // IS_SET_DEFAULT_POOL_PATH return IS_SET_DEFAULT_POOL_PATH; + case 8: // NS + return NS; default: return null; } @@ -140,7 +145,7 @@ public String getFieldName() { private static final int __ISSETQUERYPARALLELISM_ISSET_ID = 1; private static final int __ISSETDEFAULTPOOLPATH_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.NAME,_Fields.STATUS,_Fields.QUERY_PARALLELISM,_Fields.IS_SET_QUERY_PARALLELISM,_Fields.DEFAULT_POOL_PATH,_Fields.IS_SET_DEFAULT_POOL_PATH}; + private static final _Fields optionals[] = {_Fields.NAME,_Fields.STATUS,_Fields.QUERY_PARALLELISM,_Fields.IS_SET_QUERY_PARALLELISM,_Fields.DEFAULT_POOL_PATH,_Fields.IS_SET_DEFAULT_POOL_PATH,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -156,6 +161,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_SET_DEFAULT_POOL_PATH, new org.apache.thrift.meta_data.FieldMetaData("isSetDefaultPoolPath", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMNullableResourcePlan.class, metaDataMap); } @@ -180,6 +187,9 @@ public WMNullableResourcePlan(WMNullableResourcePlan other) { this.defaultPoolPath = other.defaultPoolPath; } this.isSetDefaultPoolPath = other.isSetDefaultPoolPath; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMNullableResourcePlan deepCopy() { @@ -197,6 +207,7 @@ public void clear() { this.defaultPoolPath = null; setIsSetDefaultPoolPathIsSet(false); this.isSetDefaultPoolPath = false; + this.ns = null; } public String getName() { @@ -342,6 +353,29 @@ public void setIsSetDefaultPoolPathIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISSETDEFAULTPOOLPATH_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case NAME: @@ -392,6 +426,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -415,6 +457,9 @@ public Object getFieldValue(_Fields field) { case IS_SET_DEFAULT_POOL_PATH: return isIsSetDefaultPoolPath(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -438,6 +483,8 @@ public boolean isSet(_Fields field) { return isSetDefaultPoolPath(); case IS_SET_DEFAULT_POOL_PATH: return isSetIsSetDefaultPoolPath(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -509,6 +556,15 @@ public boolean equals(WMNullableResourcePlan that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -546,6 +602,11 @@ public int hashCode() { if (present_isSetDefaultPoolPath) list.add(isSetDefaultPoolPath); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -617,6 +678,16 @@ public int compareTo(WMNullableResourcePlan other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -684,6 +755,16 @@ public String toString() { sb.append(this.isSetDefaultPoolPath); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -777,6 +858,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMNullableResourceP org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 8: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -826,6 +915,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMNullableResource oprot.writeBool(struct.isSetDefaultPoolPath); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -862,7 +958,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMNullableResourceP if (struct.isSetIsSetDefaultPoolPath()) { optionals.set(5); } - oprot.writeBitSet(optionals, 6); + if (struct.isSetNs()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); if (struct.isSetName()) { oprot.writeString(struct.name); } @@ -881,12 +980,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMNullableResourceP if (struct.isSetIsSetDefaultPoolPath()) { oprot.writeBool(struct.isSetDefaultPoolPath); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMNullableResourcePlan struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(6); + BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); @@ -911,6 +1013,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMNullableResourcePl struct.isSetDefaultPoolPath = iprot.readBool(); struct.setIsSetDefaultPoolPathIsSet(true); } + if (incoming.get(6)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPool.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPool.java index 0fc5ecfac9..ba683dd936 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPool.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPool.java @@ -43,6 +43,7 @@ private static final org.apache.thrift.protocol.TField ALLOC_FRACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("allocFraction", org.apache.thrift.protocol.TType.DOUBLE, (short)3); private static final org.apache.thrift.protocol.TField QUERY_PARALLELISM_FIELD_DESC = new org.apache.thrift.protocol.TField("queryParallelism", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField SCHEDULING_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("schedulingPolicy", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -55,6 +56,7 @@ private double allocFraction; // optional private int queryParallelism; // optional private String schedulingPolicy; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +64,8 @@ POOL_PATH((short)2, "poolPath"), ALLOC_FRACTION((short)3, "allocFraction"), QUERY_PARALLELISM((short)4, "queryParallelism"), - SCHEDULING_POLICY((short)5, "schedulingPolicy"); + SCHEDULING_POLICY((short)5, "schedulingPolicy"), + NS((short)6, "ns"); private static final Map byName = new HashMap(); @@ -87,6 +90,8 @@ public static _Fields findByThriftId(int fieldId) { return QUERY_PARALLELISM; case 5: // SCHEDULING_POLICY return SCHEDULING_POLICY; + case 6: // NS + return NS; default: return null; } @@ -130,7 +135,7 @@ public String getFieldName() { private static final int __ALLOCFRACTION_ISSET_ID = 0; private static final int __QUERYPARALLELISM_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.ALLOC_FRACTION,_Fields.QUERY_PARALLELISM,_Fields.SCHEDULING_POLICY}; + private static final _Fields optionals[] = {_Fields.ALLOC_FRACTION,_Fields.QUERY_PARALLELISM,_Fields.SCHEDULING_POLICY,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -144,6 +149,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SCHEDULING_POLICY, new org.apache.thrift.meta_data.FieldMetaData("schedulingPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMPool.class, metaDataMap); } @@ -176,6 +183,9 @@ public WMPool(WMPool other) { if (other.isSetSchedulingPolicy()) { this.schedulingPolicy = other.schedulingPolicy; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMPool deepCopy() { @@ -191,6 +201,7 @@ public void clear() { setQueryParallelismIsSet(false); this.queryParallelism = 0; this.schedulingPolicy = null; + this.ns = null; } public String getResourcePlanName() { @@ -306,6 +317,29 @@ public void setSchedulingPolicyIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -348,6 +382,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -368,6 +410,9 @@ public Object getFieldValue(_Fields field) { case SCHEDULING_POLICY: return getSchedulingPolicy(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -389,6 +434,8 @@ public boolean isSet(_Fields field) { return isSetQueryParallelism(); case SCHEDULING_POLICY: return isSetSchedulingPolicy(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -451,6 +498,15 @@ public boolean equals(WMPool that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -483,6 +539,11 @@ public int hashCode() { if (present_schedulingPolicy) list.add(schedulingPolicy); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -544,6 +605,16 @@ public int compareTo(WMPool other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -601,6 +672,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -694,6 +775,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMPool struct) thro org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -734,6 +823,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMPool struct) thr oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -763,7 +859,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMPool struct) thro if (struct.isSetSchedulingPolicy()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetNs()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetAllocFraction()) { oprot.writeDouble(struct.allocFraction); } @@ -773,6 +872,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMPool struct) thro if (struct.isSetSchedulingPolicy()) { oprot.writeString(struct.schedulingPolicy); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -782,7 +884,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMPool struct) throw struct.setResourcePlanNameIsSet(true); struct.poolPath = iprot.readString(); struct.setPoolPathIsSet(true); - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.allocFraction = iprot.readDouble(); struct.setAllocFractionIsSet(true); @@ -795,6 +897,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMPool struct) throw struct.schedulingPolicy = iprot.readString(); struct.setSchedulingPolicyIsSet(true); } + if (incoming.get(3)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPoolTrigger.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPoolTrigger.java index efbb5e60a7..d6db4589cf 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPoolTrigger.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMPoolTrigger.java @@ -40,6 +40,7 @@ private static final org.apache.thrift.protocol.TField POOL_FIELD_DESC = new org.apache.thrift.protocol.TField("pool", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TRIGGER_FIELD_DESC = new org.apache.thrift.protocol.TField("trigger", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -49,11 +50,13 @@ private String pool; // required private String trigger; // required + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { POOL((short)1, "pool"), - TRIGGER((short)2, "trigger"); + TRIGGER((short)2, "trigger"), + NS((short)3, "ns"); private static final Map byName = new HashMap(); @@ -72,6 +75,8 @@ public static _Fields findByThriftId(int fieldId) { return POOL; case 2: // TRIGGER return TRIGGER; + case 3: // NS + return NS; default: return null; } @@ -112,6 +117,7 @@ public String getFieldName() { } // isset id assignments + private static final _Fields optionals[] = {_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -119,6 +125,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TRIGGER, new org.apache.thrift.meta_data.FieldMetaData("trigger", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMPoolTrigger.class, metaDataMap); } @@ -145,6 +153,9 @@ public WMPoolTrigger(WMPoolTrigger other) { if (other.isSetTrigger()) { this.trigger = other.trigger; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMPoolTrigger deepCopy() { @@ -155,6 +166,7 @@ public WMPoolTrigger deepCopy() { public void clear() { this.pool = null; this.trigger = null; + this.ns = null; } public String getPool() { @@ -203,6 +215,29 @@ public void setTriggerIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case POOL: @@ -221,6 +256,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -232,6 +275,9 @@ public Object getFieldValue(_Fields field) { case TRIGGER: return getTrigger(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -247,6 +293,8 @@ public boolean isSet(_Fields field) { return isSetPool(); case TRIGGER: return isSetTrigger(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -282,6 +330,15 @@ public boolean equals(WMPoolTrigger that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -299,6 +356,11 @@ public int hashCode() { if (present_trigger) list.add(trigger); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -330,6 +392,16 @@ public int compareTo(WMPoolTrigger other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -365,6 +437,16 @@ public String toString() { sb.append(this.trigger); } first = false; + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -432,6 +514,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMPoolTrigger struc org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -455,6 +545,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMPoolTrigger stru oprot.writeString(struct.trigger); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -474,6 +571,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMPoolTrigger struc TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.pool); oprot.writeString(struct.trigger); + BitSet optionals = new BitSet(); + if (struct.isSetNs()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -483,6 +588,11 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMPoolTrigger struct struct.setPoolIsSet(true); struct.trigger = iprot.readString(); struct.setTriggerIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMResourcePlan.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMResourcePlan.java index d9f8c0291b..a96757bf93 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMResourcePlan.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMResourcePlan.java @@ -42,6 +42,7 @@ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField QUERY_PARALLELISM_FIELD_DESC = new org.apache.thrift.protocol.TField("queryParallelism", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField DEFAULT_POOL_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultPoolPath", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)5); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -53,6 +54,7 @@ private WMResourcePlanStatus status; // optional private int queryParallelism; // optional private String defaultPoolPath; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -63,7 +65,8 @@ */ STATUS((short)2, "status"), QUERY_PARALLELISM((short)3, "queryParallelism"), - DEFAULT_POOL_PATH((short)4, "defaultPoolPath"); + DEFAULT_POOL_PATH((short)4, "defaultPoolPath"), + NS((short)5, "ns"); private static final Map byName = new HashMap(); @@ -86,6 +89,8 @@ public static _Fields findByThriftId(int fieldId) { return QUERY_PARALLELISM; case 4: // DEFAULT_POOL_PATH return DEFAULT_POOL_PATH; + case 5: // NS + return NS; default: return null; } @@ -128,7 +133,7 @@ public String getFieldName() { // isset id assignments private static final int __QUERYPARALLELISM_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.STATUS,_Fields.QUERY_PARALLELISM,_Fields.DEFAULT_POOL_PATH}; + private static final _Fields optionals[] = {_Fields.STATUS,_Fields.QUERY_PARALLELISM,_Fields.DEFAULT_POOL_PATH,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -140,6 +145,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DEFAULT_POOL_PATH, new org.apache.thrift.meta_data.FieldMetaData("defaultPoolPath", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMResourcePlan.class, metaDataMap); } @@ -169,6 +176,9 @@ public WMResourcePlan(WMResourcePlan other) { if (other.isSetDefaultPoolPath()) { this.defaultPoolPath = other.defaultPoolPath; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMResourcePlan deepCopy() { @@ -182,6 +192,7 @@ public void clear() { setQueryParallelismIsSet(false); this.queryParallelism = 0; this.defaultPoolPath = null; + this.ns = null; } public String getName() { @@ -283,6 +294,29 @@ public void setDefaultPoolPathIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case NAME: @@ -317,6 +351,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -334,6 +376,9 @@ public Object getFieldValue(_Fields field) { case DEFAULT_POOL_PATH: return getDefaultPoolPath(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -353,6 +398,8 @@ public boolean isSet(_Fields field) { return isSetQueryParallelism(); case DEFAULT_POOL_PATH: return isSetDefaultPoolPath(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -406,6 +453,15 @@ public boolean equals(WMResourcePlan that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -433,6 +489,11 @@ public int hashCode() { if (present_defaultPoolPath) list.add(defaultPoolPath); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -484,6 +545,16 @@ public int compareTo(WMResourcePlan other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -537,6 +608,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -618,6 +699,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMResourcePlan stru org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -655,6 +744,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMResourcePlan str oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -683,7 +779,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMResourcePlan stru if (struct.isSetDefaultPoolPath()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetNs()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetStatus()) { oprot.writeI32(struct.status.getValue()); } @@ -693,6 +792,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMResourcePlan stru if (struct.isSetDefaultPoolPath()) { oprot.writeString(struct.defaultPoolPath); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -700,7 +802,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMResourcePlan struc TTupleProtocol iprot = (TTupleProtocol) prot; struct.name = iprot.readString(); struct.setNameIsSet(true); - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.status = org.apache.hadoop.hive.metastore.api.WMResourcePlanStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); @@ -713,6 +815,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMResourcePlan struc struct.defaultPoolPath = iprot.readString(); struct.setDefaultPoolPathIsSet(true); } + if (incoming.get(3)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMTrigger.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMTrigger.java index 63bd40f2b4..820b6d5b61 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMTrigger.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMTrigger.java @@ -43,6 +43,7 @@ private static final org.apache.thrift.protocol.TField TRIGGER_EXPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("triggerExpression", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField ACTION_EXPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("actionExpression", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField IS_IN_UNMANAGED_FIELD_DESC = new org.apache.thrift.protocol.TField("isInUnmanaged", org.apache.thrift.protocol.TType.BOOL, (short)5); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -55,6 +56,7 @@ private String triggerExpression; // optional private String actionExpression; // optional private boolean isInUnmanaged; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +64,8 @@ TRIGGER_NAME((short)2, "triggerName"), TRIGGER_EXPRESSION((short)3, "triggerExpression"), ACTION_EXPRESSION((short)4, "actionExpression"), - IS_IN_UNMANAGED((short)5, "isInUnmanaged"); + IS_IN_UNMANAGED((short)5, "isInUnmanaged"), + NS((short)6, "ns"); private static final Map byName = new HashMap(); @@ -87,6 +90,8 @@ public static _Fields findByThriftId(int fieldId) { return ACTION_EXPRESSION; case 5: // IS_IN_UNMANAGED return IS_IN_UNMANAGED; + case 6: // NS + return NS; default: return null; } @@ -129,7 +134,7 @@ public String getFieldName() { // isset id assignments private static final int __ISINUNMANAGED_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.TRIGGER_EXPRESSION,_Fields.ACTION_EXPRESSION,_Fields.IS_IN_UNMANAGED}; + private static final _Fields optionals[] = {_Fields.TRIGGER_EXPRESSION,_Fields.ACTION_EXPRESSION,_Fields.IS_IN_UNMANAGED,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -143,6 +148,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IS_IN_UNMANAGED, new org.apache.thrift.meta_data.FieldMetaData("isInUnmanaged", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMTrigger.class, metaDataMap); } @@ -177,6 +184,9 @@ public WMTrigger(WMTrigger other) { this.actionExpression = other.actionExpression; } this.isInUnmanaged = other.isInUnmanaged; + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMTrigger deepCopy() { @@ -191,6 +201,7 @@ public void clear() { this.actionExpression = null; setIsInUnmanagedIsSet(false); this.isInUnmanaged = false; + this.ns = null; } public String getResourcePlanName() { @@ -307,6 +318,29 @@ public void setIsInUnmanagedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISINUNMANAGED_ISSET_ID, value); } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -349,6 +383,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -369,6 +411,9 @@ public Object getFieldValue(_Fields field) { case IS_IN_UNMANAGED: return isIsInUnmanaged(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -390,6 +435,8 @@ public boolean isSet(_Fields field) { return isSetActionExpression(); case IS_IN_UNMANAGED: return isSetIsInUnmanaged(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -452,6 +499,15 @@ public boolean equals(WMTrigger that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -484,6 +540,11 @@ public int hashCode() { if (present_isInUnmanaged) list.add(isInUnmanaged); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -545,6 +606,16 @@ public int compareTo(WMTrigger other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -606,6 +677,16 @@ public String toString() { sb.append(this.isInUnmanaged); first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -699,6 +780,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMTrigger struct) t org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -741,6 +830,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMTrigger struct) oprot.writeBool(struct.isInUnmanaged); oprot.writeFieldEnd(); } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -770,7 +866,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMTrigger struct) t if (struct.isSetIsInUnmanaged()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetNs()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetTriggerExpression()) { oprot.writeString(struct.triggerExpression); } @@ -780,6 +879,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMTrigger struct) t if (struct.isSetIsInUnmanaged()) { oprot.writeBool(struct.isInUnmanaged); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override @@ -789,7 +891,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMTrigger struct) th struct.setResourcePlanNameIsSet(true); struct.triggerName = iprot.readString(); struct.setTriggerNameIsSet(true); - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.triggerExpression = iprot.readString(); struct.setTriggerExpressionIsSet(true); @@ -802,6 +904,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, WMTrigger struct) th struct.isInUnmanaged = iprot.readBool(); struct.setIsInUnmanagedIsSet(true); } + if (incoming.get(3)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMValidateResourcePlanRequest.java standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMValidateResourcePlanRequest.java index aad6d439f1..0c81199e31 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMValidateResourcePlanRequest.java +++ standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMValidateResourcePlanRequest.java @@ -39,6 +39,7 @@ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WMValidateResourcePlanRequest"); private static final org.apache.thrift.protocol.TField RESOURCE_PLAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePlanName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NS_FIELD_DESC = new org.apache.thrift.protocol.TField("ns", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -47,10 +48,12 @@ } private String resourcePlanName; // optional + private String ns; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - RESOURCE_PLAN_NAME((short)1, "resourcePlanName"); + RESOURCE_PLAN_NAME((short)1, "resourcePlanName"), + NS((short)2, "ns"); private static final Map byName = new HashMap(); @@ -67,6 +70,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RESOURCE_PLAN_NAME return RESOURCE_PLAN_NAME; + case 2: // NS + return NS; default: return null; } @@ -107,12 +112,14 @@ public String getFieldName() { } // isset id assignments - private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_PLAN_NAME,_Fields.NS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESOURCE_PLAN_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourcePlanName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NS, new org.apache.thrift.meta_data.FieldMetaData("ns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WMValidateResourcePlanRequest.class, metaDataMap); } @@ -127,6 +134,9 @@ public WMValidateResourcePlanRequest(WMValidateResourcePlanRequest other) { if (other.isSetResourcePlanName()) { this.resourcePlanName = other.resourcePlanName; } + if (other.isSetNs()) { + this.ns = other.ns; + } } public WMValidateResourcePlanRequest deepCopy() { @@ -136,6 +146,7 @@ public WMValidateResourcePlanRequest deepCopy() { @Override public void clear() { this.resourcePlanName = null; + this.ns = null; } public String getResourcePlanName() { @@ -161,6 +172,29 @@ public void setResourcePlanNameIsSet(boolean value) { } } + public String getNs() { + return this.ns; + } + + public void setNs(String ns) { + this.ns = ns; + } + + public void unsetNs() { + this.ns = null; + } + + /** Returns true if field ns is set (has been assigned a value) and false otherwise */ + public boolean isSetNs() { + return this.ns != null; + } + + public void setNsIsSet(boolean value) { + if (!value) { + this.ns = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_PLAN_NAME: @@ -171,6 +205,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case NS: + if (value == null) { + unsetNs(); + } else { + setNs((String)value); + } + break; + } } @@ -179,6 +221,9 @@ public Object getFieldValue(_Fields field) { case RESOURCE_PLAN_NAME: return getResourcePlanName(); + case NS: + return getNs(); + } throw new IllegalStateException(); } @@ -192,6 +237,8 @@ public boolean isSet(_Fields field) { switch (field) { case RESOURCE_PLAN_NAME: return isSetResourcePlanName(); + case NS: + return isSetNs(); } throw new IllegalStateException(); } @@ -218,6 +265,15 @@ public boolean equals(WMValidateResourcePlanRequest that) { return false; } + boolean this_present_ns = true && this.isSetNs(); + boolean that_present_ns = true && that.isSetNs(); + if (this_present_ns || that_present_ns) { + if (!(this_present_ns && that_present_ns)) + return false; + if (!this.ns.equals(that.ns)) + return false; + } + return true; } @@ -230,6 +286,11 @@ public int hashCode() { if (present_resourcePlanName) list.add(resourcePlanName); + boolean present_ns = true && (isSetNs()); + list.add(present_ns); + if (present_ns) + list.add(ns); + return list.hashCode(); } @@ -251,6 +312,16 @@ public int compareTo(WMValidateResourcePlanRequest other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetNs()).compareTo(other.isSetNs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ns, other.ns); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -280,6 +351,16 @@ public String toString() { } first = false; } + if (isSetNs()) { + if (!first) sb.append(", "); + sb.append("ns:"); + if (this.ns == null) { + sb.append("null"); + } else { + sb.append(this.ns); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -331,6 +412,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, WMValidateResourceP org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 2: // NS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -351,6 +440,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, WMValidateResource oprot.writeFieldEnd(); } } + if (struct.ns != null) { + if (struct.isSetNs()) { + oprot.writeFieldBegin(NS_FIELD_DESC); + oprot.writeString(struct.ns); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -372,20 +468,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, WMValidateResourceP if (struct.isSetResourcePlanName()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetNs()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); if (struct.isSetResourcePlanName()) { oprot.writeString(struct.resourcePlanName); } + if (struct.isSetNs()) { + oprot.writeString(struct.ns); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WMValidateResourcePlanRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.resourcePlanName = iprot.readString(); struct.setResourcePlanNameIsSet(true); } + if (incoming.get(1)) { + struct.ns = iprot.readString(); + struct.setNsIsSet(true); + } } } diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php index 5fd5d782ea..bf6dfba0cc 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php +++ standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php @@ -26084,6 +26084,10 @@ class WMResourcePlan { * @var string */ public $defaultPoolPath = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26104,6 +26108,10 @@ class WMResourcePlan { 'var' => 'defaultPoolPath', 'type' => TType::STRING, ), + 5 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26119,6 +26127,9 @@ class WMResourcePlan { if (isset($vals['defaultPoolPath'])) { $this->defaultPoolPath = $vals['defaultPoolPath']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -26169,6 +26180,13 @@ class WMResourcePlan { $xfer += $input->skip($ftype); } break; + case 5: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -26202,6 +26220,11 @@ class WMResourcePlan { $xfer += $output->writeString($this->defaultPoolPath); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 5); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -26236,6 +26259,10 @@ class WMNullableResourcePlan { * @var bool */ public $isSetDefaultPoolPath = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26264,6 +26291,10 @@ class WMNullableResourcePlan { 'var' => 'isSetDefaultPoolPath', 'type' => TType::BOOL, ), + 8 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26285,6 +26316,9 @@ class WMNullableResourcePlan { if (isset($vals['isSetDefaultPoolPath'])) { $this->isSetDefaultPoolPath = $vals['isSetDefaultPoolPath']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -26349,6 +26383,13 @@ class WMNullableResourcePlan { $xfer += $input->skip($ftype); } break; + case 8: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -26392,6 +26433,11 @@ class WMNullableResourcePlan { $xfer += $output->writeBool($this->isSetDefaultPoolPath); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 8); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -26422,6 +26468,10 @@ class WMPool { * @var string */ public $schedulingPolicy = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26446,6 +26496,10 @@ class WMPool { 'var' => 'schedulingPolicy', 'type' => TType::STRING, ), + 6 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26464,6 +26518,9 @@ class WMPool { if (isset($vals['schedulingPolicy'])) { $this->schedulingPolicy = $vals['schedulingPolicy']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -26521,6 +26578,13 @@ class WMPool { $xfer += $input->skip($ftype); } break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -26559,6 +26623,11 @@ class WMPool { $xfer += $output->writeString($this->schedulingPolicy); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 6); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -26593,6 +26662,10 @@ class WMNullablePool { * @var bool */ public $isSetSchedulingPolicy = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26621,6 +26694,10 @@ class WMNullablePool { 'var' => 'isSetSchedulingPolicy', 'type' => TType::BOOL, ), + 7 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26642,6 +26719,9 @@ class WMNullablePool { if (isset($vals['isSetSchedulingPolicy'])) { $this->isSetSchedulingPolicy = $vals['isSetSchedulingPolicy']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -26706,6 +26786,13 @@ class WMNullablePool { $xfer += $input->skip($ftype); } break; + case 7: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -26749,6 +26836,11 @@ class WMNullablePool { $xfer += $output->writeBool($this->isSetSchedulingPolicy); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 7); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -26779,6 +26871,10 @@ class WMTrigger { * @var bool */ public $isInUnmanaged = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26803,6 +26899,10 @@ class WMTrigger { 'var' => 'isInUnmanaged', 'type' => TType::BOOL, ), + 6 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26821,6 +26921,9 @@ class WMTrigger { if (isset($vals['isInUnmanaged'])) { $this->isInUnmanaged = $vals['isInUnmanaged']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -26878,6 +26981,13 @@ class WMTrigger { $xfer += $input->skip($ftype); } break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -26916,6 +27026,11 @@ class WMTrigger { $xfer += $output->writeBool($this->isInUnmanaged); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 6); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -26946,6 +27061,10 @@ class WMMapping { * @var int */ public $ordering = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -26970,6 +27089,10 @@ class WMMapping { 'var' => 'ordering', 'type' => TType::I32, ), + 6 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -26988,6 +27111,9 @@ class WMMapping { if (isset($vals['ordering'])) { $this->ordering = $vals['ordering']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -27045,6 +27171,13 @@ class WMMapping { $xfer += $input->skip($ftype); } break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -27083,6 +27216,11 @@ class WMMapping { $xfer += $output->writeI32($this->ordering); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 6); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -27101,6 +27239,10 @@ class WMPoolTrigger { * @var string */ public $trigger = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -27113,6 +27255,10 @@ class WMPoolTrigger { 'var' => 'trigger', 'type' => TType::STRING, ), + 3 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -27122,6 +27268,9 @@ class WMPoolTrigger { if (isset($vals['trigger'])) { $this->trigger = $vals['trigger']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -27158,6 +27307,13 @@ class WMPoolTrigger { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -27181,6 +27337,11 @@ class WMPoolTrigger { $xfer += $output->writeString($this->trigger); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 3); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -27628,12 +27789,25 @@ class WMCreateResourcePlanResponse { class WMGetActiveResourcePlanRequest { static $_TSPEC; + /** + * @var string + */ + public $ns = null; - public function __construct() { + public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( + 1 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } + if (is_array($vals)) { + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } + } } public function getName() { @@ -27655,6 +27829,13 @@ class WMGetActiveResourcePlanRequest { } switch ($fid) { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -27668,6 +27849,11 @@ class WMGetActiveResourcePlanRequest { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('WMGetActiveResourcePlanRequest'); + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 1); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -27762,6 +27948,10 @@ class WMGetResourcePlanRequest { * @var string */ public $resourcePlanName = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -27770,12 +27960,19 @@ class WMGetResourcePlanRequest { 'var' => 'resourcePlanName', 'type' => TType::STRING, ), + 2 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { if (isset($vals['resourcePlanName'])) { $this->resourcePlanName = $vals['resourcePlanName']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -27805,6 +28002,13 @@ class WMGetResourcePlanRequest { $xfer += $input->skip($ftype); } break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -27823,6 +28027,11 @@ class WMGetResourcePlanRequest { $xfer += $output->writeString($this->resourcePlanName); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 2); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -27913,12 +28122,25 @@ class WMGetResourcePlanResponse { class WMGetAllResourcePlanRequest { static $_TSPEC; + /** + * @var string + */ + public $ns = null; - public function __construct() { + public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( + 1 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } + if (is_array($vals)) { + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } + } } public function getName() { @@ -27940,6 +28162,13 @@ class WMGetAllResourcePlanRequest { } switch ($fid) { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -27953,6 +28182,11 @@ class WMGetAllResourcePlanRequest { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('WMGetAllResourcePlanRequest'); + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 1); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -28086,6 +28320,10 @@ class WMAlterResourcePlanRequest { * @var bool */ public $isReplace = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -28111,6 +28349,10 @@ class WMAlterResourcePlanRequest { 'var' => 'isReplace', 'type' => TType::BOOL, ), + 6 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -28129,6 +28371,9 @@ class WMAlterResourcePlanRequest { if (isset($vals['isReplace'])) { $this->isReplace = $vals['isReplace']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -28187,6 +28432,13 @@ class WMAlterResourcePlanRequest { $xfer += $input->skip($ftype); } break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -28228,6 +28480,11 @@ class WMAlterResourcePlanRequest { $xfer += $output->writeBool($this->isReplace); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 6); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -28322,6 +28579,10 @@ class WMValidateResourcePlanRequest { * @var string */ public $resourcePlanName = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -28330,12 +28591,19 @@ class WMValidateResourcePlanRequest { 'var' => 'resourcePlanName', 'type' => TType::STRING, ), + 2 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { if (isset($vals['resourcePlanName'])) { $this->resourcePlanName = $vals['resourcePlanName']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -28365,6 +28633,13 @@ class WMValidateResourcePlanRequest { $xfer += $input->skip($ftype); } break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -28383,6 +28658,11 @@ class WMValidateResourcePlanRequest { $xfer += $output->writeString($this->resourcePlanName); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 2); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -28547,6 +28827,10 @@ class WMDropResourcePlanRequest { * @var string */ public $resourcePlanName = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -28555,12 +28839,19 @@ class WMDropResourcePlanRequest { 'var' => 'resourcePlanName', 'type' => TType::STRING, ), + 2 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { if (isset($vals['resourcePlanName'])) { $this->resourcePlanName = $vals['resourcePlanName']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -28590,6 +28881,13 @@ class WMDropResourcePlanRequest { $xfer += $input->skip($ftype); } break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -28608,6 +28906,11 @@ class WMDropResourcePlanRequest { $xfer += $output->writeString($this->resourcePlanName); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 2); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -28936,6 +29239,10 @@ class WMDropTriggerRequest { * @var string */ public $triggerName = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -28948,6 +29255,10 @@ class WMDropTriggerRequest { 'var' => 'triggerName', 'type' => TType::STRING, ), + 3 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -28957,6 +29268,9 @@ class WMDropTriggerRequest { if (isset($vals['triggerName'])) { $this->triggerName = $vals['triggerName']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -28993,6 +29307,13 @@ class WMDropTriggerRequest { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -29016,6 +29337,11 @@ class WMDropTriggerRequest { $xfer += $output->writeString($this->triggerName); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 3); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -29080,6 +29406,10 @@ class WMGetTriggersForResourePlanRequest { * @var string */ public $resourcePlanName = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -29088,12 +29418,19 @@ class WMGetTriggersForResourePlanRequest { 'var' => 'resourcePlanName', 'type' => TType::STRING, ), + 2 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { if (isset($vals['resourcePlanName'])) { $this->resourcePlanName = $vals['resourcePlanName']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -29123,6 +29460,13 @@ class WMGetTriggersForResourePlanRequest { $xfer += $input->skip($ftype); } break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -29141,6 +29485,11 @@ class WMGetTriggersForResourePlanRequest { $xfer += $output->writeString($this->resourcePlanName); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 2); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -29545,6 +29894,10 @@ class WMDropPoolRequest { * @var string */ public $poolPath = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -29557,6 +29910,10 @@ class WMDropPoolRequest { 'var' => 'poolPath', 'type' => TType::STRING, ), + 3 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -29566,6 +29923,9 @@ class WMDropPoolRequest { if (isset($vals['poolPath'])) { $this->poolPath = $vals['poolPath']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -29602,6 +29962,13 @@ class WMDropPoolRequest { $xfer += $input->skip($ftype); } break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -29625,6 +29992,11 @@ class WMDropPoolRequest { $xfer += $output->writeString($this->poolPath); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 3); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -29984,6 +30356,10 @@ class WMCreateOrDropTriggerToPoolMappingRequest { * @var bool */ public $drop = null; + /** + * @var string + */ + public $ns = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -30004,6 +30380,10 @@ class WMCreateOrDropTriggerToPoolMappingRequest { 'var' => 'drop', 'type' => TType::BOOL, ), + 5 => array( + 'var' => 'ns', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -30019,6 +30399,9 @@ class WMCreateOrDropTriggerToPoolMappingRequest { if (isset($vals['drop'])) { $this->drop = $vals['drop']; } + if (isset($vals['ns'])) { + $this->ns = $vals['ns']; + } } } @@ -30069,6 +30452,13 @@ class WMCreateOrDropTriggerToPoolMappingRequest { $xfer += $input->skip($ftype); } break; + case 5: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->ns); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -30102,6 +30492,11 @@ class WMCreateOrDropTriggerToPoolMappingRequest { $xfer += $output->writeBool($this->drop); $xfer += $output->writeFieldEnd(); } + if ($this->ns !== null) { + $xfer += $output->writeFieldBegin('ns', TType::STRING, 5); + $xfer += $output->writeString($this->ns); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py index 03c2a4ee95..bdfb480723 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -18352,6 +18352,7 @@ class WMResourcePlan: - status - queryParallelism - defaultPoolPath + - ns """ thrift_spec = ( @@ -18360,13 +18361,15 @@ class WMResourcePlan: (2, TType.I32, 'status', None, None, ), # 2 (3, TType.I32, 'queryParallelism', None, None, ), # 3 (4, TType.STRING, 'defaultPoolPath', None, None, ), # 4 + (5, TType.STRING, 'ns', None, None, ), # 5 ) - def __init__(self, name=None, status=None, queryParallelism=None, defaultPoolPath=None,): + def __init__(self, name=None, status=None, queryParallelism=None, defaultPoolPath=None, ns=None,): self.name = name self.status = status self.queryParallelism = queryParallelism self.defaultPoolPath = defaultPoolPath + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -18397,6 +18400,11 @@ def read(self, iprot): self.defaultPoolPath = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -18423,6 +18431,10 @@ def write(self, oprot): oprot.writeFieldBegin('defaultPoolPath', TType.STRING, 4) oprot.writeString(self.defaultPoolPath) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 5) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -18438,6 +18450,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.status) value = (value * 31) ^ hash(self.queryParallelism) value = (value * 31) ^ hash(self.defaultPoolPath) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -18460,6 +18473,7 @@ class WMNullableResourcePlan: - isSetQueryParallelism - defaultPoolPath - isSetDefaultPoolPath + - ns """ thrift_spec = ( @@ -18471,15 +18485,17 @@ class WMNullableResourcePlan: (5, TType.BOOL, 'isSetQueryParallelism', None, None, ), # 5 (6, TType.STRING, 'defaultPoolPath', None, None, ), # 6 (7, TType.BOOL, 'isSetDefaultPoolPath', None, None, ), # 7 + (8, TType.STRING, 'ns', None, None, ), # 8 ) - def __init__(self, name=None, status=None, queryParallelism=None, isSetQueryParallelism=None, defaultPoolPath=None, isSetDefaultPoolPath=None,): + def __init__(self, name=None, status=None, queryParallelism=None, isSetQueryParallelism=None, defaultPoolPath=None, isSetDefaultPoolPath=None, ns=None,): self.name = name self.status = status self.queryParallelism = queryParallelism self.isSetQueryParallelism = isSetQueryParallelism self.defaultPoolPath = defaultPoolPath self.isSetDefaultPoolPath = isSetDefaultPoolPath + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -18520,6 +18536,11 @@ def read(self, iprot): self.isSetDefaultPoolPath = iprot.readBool() else: iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -18554,6 +18575,10 @@ def write(self, oprot): oprot.writeFieldBegin('isSetDefaultPoolPath', TType.BOOL, 7) oprot.writeBool(self.isSetDefaultPoolPath) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 8) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -18569,6 +18594,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.isSetQueryParallelism) value = (value * 31) ^ hash(self.defaultPoolPath) value = (value * 31) ^ hash(self.isSetDefaultPoolPath) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -18590,6 +18616,7 @@ class WMPool: - allocFraction - queryParallelism - schedulingPolicy + - ns """ thrift_spec = ( @@ -18599,14 +18626,16 @@ class WMPool: (3, TType.DOUBLE, 'allocFraction', None, None, ), # 3 (4, TType.I32, 'queryParallelism', None, None, ), # 4 (5, TType.STRING, 'schedulingPolicy', None, None, ), # 5 + (6, TType.STRING, 'ns', None, None, ), # 6 ) - def __init__(self, resourcePlanName=None, poolPath=None, allocFraction=None, queryParallelism=None, schedulingPolicy=None,): + def __init__(self, resourcePlanName=None, poolPath=None, allocFraction=None, queryParallelism=None, schedulingPolicy=None, ns=None,): self.resourcePlanName = resourcePlanName self.poolPath = poolPath self.allocFraction = allocFraction self.queryParallelism = queryParallelism self.schedulingPolicy = schedulingPolicy + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -18642,6 +18671,11 @@ def read(self, iprot): self.schedulingPolicy = iprot.readString() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -18672,6 +18706,10 @@ def write(self, oprot): oprot.writeFieldBegin('schedulingPolicy', TType.STRING, 5) oprot.writeString(self.schedulingPolicy) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 6) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -18690,6 +18728,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.allocFraction) value = (value * 31) ^ hash(self.queryParallelism) value = (value * 31) ^ hash(self.schedulingPolicy) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -18712,6 +18751,7 @@ class WMNullablePool: - queryParallelism - schedulingPolicy - isSetSchedulingPolicy + - ns """ thrift_spec = ( @@ -18722,15 +18762,17 @@ class WMNullablePool: (4, TType.I32, 'queryParallelism', None, None, ), # 4 (5, TType.STRING, 'schedulingPolicy', None, None, ), # 5 (6, TType.BOOL, 'isSetSchedulingPolicy', None, None, ), # 6 + (7, TType.STRING, 'ns', None, None, ), # 7 ) - def __init__(self, resourcePlanName=None, poolPath=None, allocFraction=None, queryParallelism=None, schedulingPolicy=None, isSetSchedulingPolicy=None,): + def __init__(self, resourcePlanName=None, poolPath=None, allocFraction=None, queryParallelism=None, schedulingPolicy=None, isSetSchedulingPolicy=None, ns=None,): self.resourcePlanName = resourcePlanName self.poolPath = poolPath self.allocFraction = allocFraction self.queryParallelism = queryParallelism self.schedulingPolicy = schedulingPolicy self.isSetSchedulingPolicy = isSetSchedulingPolicy + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -18771,6 +18813,11 @@ def read(self, iprot): self.isSetSchedulingPolicy = iprot.readBool() else: iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -18805,6 +18852,10 @@ def write(self, oprot): oprot.writeFieldBegin('isSetSchedulingPolicy', TType.BOOL, 6) oprot.writeBool(self.isSetSchedulingPolicy) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 7) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -18824,6 +18875,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.queryParallelism) value = (value * 31) ^ hash(self.schedulingPolicy) value = (value * 31) ^ hash(self.isSetSchedulingPolicy) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -18845,6 +18897,7 @@ class WMTrigger: - triggerExpression - actionExpression - isInUnmanaged + - ns """ thrift_spec = ( @@ -18854,14 +18907,16 @@ class WMTrigger: (3, TType.STRING, 'triggerExpression', None, None, ), # 3 (4, TType.STRING, 'actionExpression', None, None, ), # 4 (5, TType.BOOL, 'isInUnmanaged', None, None, ), # 5 + (6, TType.STRING, 'ns', None, None, ), # 6 ) - def __init__(self, resourcePlanName=None, triggerName=None, triggerExpression=None, actionExpression=None, isInUnmanaged=None,): + def __init__(self, resourcePlanName=None, triggerName=None, triggerExpression=None, actionExpression=None, isInUnmanaged=None, ns=None,): self.resourcePlanName = resourcePlanName self.triggerName = triggerName self.triggerExpression = triggerExpression self.actionExpression = actionExpression self.isInUnmanaged = isInUnmanaged + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -18897,6 +18952,11 @@ def read(self, iprot): self.isInUnmanaged = iprot.readBool() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -18927,6 +18987,10 @@ def write(self, oprot): oprot.writeFieldBegin('isInUnmanaged', TType.BOOL, 5) oprot.writeBool(self.isInUnmanaged) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 6) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -18945,6 +19009,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.triggerExpression) value = (value * 31) ^ hash(self.actionExpression) value = (value * 31) ^ hash(self.isInUnmanaged) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -18966,6 +19031,7 @@ class WMMapping: - entityName - poolPath - ordering + - ns """ thrift_spec = ( @@ -18975,14 +19041,16 @@ class WMMapping: (3, TType.STRING, 'entityName', None, None, ), # 3 (4, TType.STRING, 'poolPath', None, None, ), # 4 (5, TType.I32, 'ordering', None, None, ), # 5 + (6, TType.STRING, 'ns', None, None, ), # 6 ) - def __init__(self, resourcePlanName=None, entityType=None, entityName=None, poolPath=None, ordering=None,): + def __init__(self, resourcePlanName=None, entityType=None, entityName=None, poolPath=None, ordering=None, ns=None,): self.resourcePlanName = resourcePlanName self.entityType = entityType self.entityName = entityName self.poolPath = poolPath self.ordering = ordering + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -19018,6 +19086,11 @@ def read(self, iprot): self.ordering = iprot.readI32() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19048,6 +19121,10 @@ def write(self, oprot): oprot.writeFieldBegin('ordering', TType.I32, 5) oprot.writeI32(self.ordering) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 6) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19068,6 +19145,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.entityName) value = (value * 31) ^ hash(self.poolPath) value = (value * 31) ^ hash(self.ordering) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19086,17 +19164,20 @@ class WMPoolTrigger: Attributes: - pool - trigger + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'pool', None, None, ), # 1 (2, TType.STRING, 'trigger', None, None, ), # 2 + (3, TType.STRING, 'ns', None, None, ), # 3 ) - def __init__(self, pool=None, trigger=None,): + def __init__(self, pool=None, trigger=None, ns=None,): self.pool = pool self.trigger = trigger + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -19117,6 +19198,11 @@ def read(self, iprot): self.trigger = iprot.readString() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19135,6 +19221,10 @@ def write(self, oprot): oprot.writeFieldBegin('trigger', TType.STRING, 2) oprot.writeString(self.trigger) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 3) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19150,6 +19240,7 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.pool) value = (value * 31) ^ hash(self.trigger) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19447,10 +19538,19 @@ def __ne__(self, other): return not (self == other) class WMGetActiveResourcePlanRequest: + """ + Attributes: + - ns + """ thrift_spec = ( + None, # 0 + (1, TType.STRING, 'ns', None, None, ), # 1 ) + def __init__(self, ns=None,): + self.ns = ns + def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) @@ -19460,6 +19560,11 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19470,6 +19575,10 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('WMGetActiveResourcePlanRequest') + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 1) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19479,6 +19588,7 @@ def validate(self): def __hash__(self): value = 17 + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19562,15 +19672,18 @@ class WMGetResourcePlanRequest: """ Attributes: - resourcePlanName + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'ns', None, None, ), # 2 ) - def __init__(self, resourcePlanName=None,): + def __init__(self, resourcePlanName=None, ns=None,): self.resourcePlanName = resourcePlanName + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -19586,6 +19699,11 @@ def read(self, iprot): self.resourcePlanName = iprot.readString() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19600,6 +19718,10 @@ def write(self, oprot): oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) oprot.writeString(self.resourcePlanName) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 2) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19610,6 +19732,7 @@ def validate(self): def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19690,10 +19813,19 @@ def __ne__(self, other): return not (self == other) class WMGetAllResourcePlanRequest: + """ + Attributes: + - ns + """ thrift_spec = ( + None, # 0 + (1, TType.STRING, 'ns', None, None, ), # 1 ) + def __init__(self, ns=None,): + self.ns = ns + def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) @@ -19703,6 +19835,11 @@ def read(self, iprot): (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19713,6 +19850,10 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('WMGetAllResourcePlanRequest') + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 1) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19722,6 +19863,7 @@ def validate(self): def __hash__(self): value = 17 + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19817,6 +19959,7 @@ class WMAlterResourcePlanRequest: - isEnableAndActivate - isForceDeactivate - isReplace + - ns """ thrift_spec = ( @@ -19826,14 +19969,16 @@ class WMAlterResourcePlanRequest: (3, TType.BOOL, 'isEnableAndActivate', None, None, ), # 3 (4, TType.BOOL, 'isForceDeactivate', None, None, ), # 4 (5, TType.BOOL, 'isReplace', None, None, ), # 5 + (6, TType.STRING, 'ns', None, None, ), # 6 ) - def __init__(self, resourcePlanName=None, resourcePlan=None, isEnableAndActivate=None, isForceDeactivate=None, isReplace=None,): + def __init__(self, resourcePlanName=None, resourcePlan=None, isEnableAndActivate=None, isForceDeactivate=None, isReplace=None, ns=None,): self.resourcePlanName = resourcePlanName self.resourcePlan = resourcePlan self.isEnableAndActivate = isEnableAndActivate self.isForceDeactivate = isForceDeactivate self.isReplace = isReplace + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -19870,6 +20015,11 @@ def read(self, iprot): self.isReplace = iprot.readBool() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -19900,6 +20050,10 @@ def write(self, oprot): oprot.writeFieldBegin('isReplace', TType.BOOL, 5) oprot.writeBool(self.isReplace) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 6) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -19914,6 +20068,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.isEnableAndActivate) value = (value * 31) ^ hash(self.isForceDeactivate) value = (value * 31) ^ hash(self.isReplace) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -19997,15 +20152,18 @@ class WMValidateResourcePlanRequest: """ Attributes: - resourcePlanName + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'ns', None, None, ), # 2 ) - def __init__(self, resourcePlanName=None,): + def __init__(self, resourcePlanName=None, ns=None,): self.resourcePlanName = resourcePlanName + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20021,6 +20179,11 @@ def read(self, iprot): self.resourcePlanName = iprot.readString() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20035,6 +20198,10 @@ def write(self, oprot): oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) oprot.writeString(self.resourcePlanName) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 2) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -20045,6 +20212,7 @@ def validate(self): def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -20156,15 +20324,18 @@ class WMDropResourcePlanRequest: """ Attributes: - resourcePlanName + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'ns', None, None, ), # 2 ) - def __init__(self, resourcePlanName=None,): + def __init__(self, resourcePlanName=None, ns=None,): self.resourcePlanName = resourcePlanName + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20180,6 +20351,11 @@ def read(self, iprot): self.resourcePlanName = iprot.readString() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20194,6 +20370,10 @@ def write(self, oprot): oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) oprot.writeString(self.resourcePlanName) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 2) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -20204,6 +20384,7 @@ def validate(self): def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -20492,17 +20673,20 @@ class WMDropTriggerRequest: Attributes: - resourcePlanName - triggerName + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 (2, TType.STRING, 'triggerName', None, None, ), # 2 + (3, TType.STRING, 'ns', None, None, ), # 3 ) - def __init__(self, resourcePlanName=None, triggerName=None,): + def __init__(self, resourcePlanName=None, triggerName=None, ns=None,): self.resourcePlanName = resourcePlanName self.triggerName = triggerName + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20523,6 +20707,11 @@ def read(self, iprot): self.triggerName = iprot.readString() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20541,6 +20730,10 @@ def write(self, oprot): oprot.writeFieldBegin('triggerName', TType.STRING, 2) oprot.writeString(self.triggerName) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 3) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -20552,6 +20745,7 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) value = (value * 31) ^ hash(self.triggerName) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -20615,15 +20809,18 @@ class WMGetTriggersForResourePlanRequest: """ Attributes: - resourcePlanName + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'ns', None, None, ), # 2 ) - def __init__(self, resourcePlanName=None,): + def __init__(self, resourcePlanName=None, ns=None,): self.resourcePlanName = resourcePlanName + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -20639,6 +20836,11 @@ def read(self, iprot): self.resourcePlanName = iprot.readString() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -20653,6 +20855,10 @@ def write(self, oprot): oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) oprot.writeString(self.resourcePlanName) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 2) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -20663,6 +20869,7 @@ def validate(self): def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -20992,17 +21199,20 @@ class WMDropPoolRequest: Attributes: - resourcePlanName - poolPath + - ns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 (2, TType.STRING, 'poolPath', None, None, ), # 2 + (3, TType.STRING, 'ns', None, None, ), # 3 ) - def __init__(self, resourcePlanName=None, poolPath=None,): + def __init__(self, resourcePlanName=None, poolPath=None, ns=None,): self.resourcePlanName = resourcePlanName self.poolPath = poolPath + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -21023,6 +21233,11 @@ def read(self, iprot): self.poolPath = iprot.readString() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -21041,6 +21256,10 @@ def write(self, oprot): oprot.writeFieldBegin('poolPath', TType.STRING, 2) oprot.writeString(self.poolPath) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 3) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -21052,6 +21271,7 @@ def __hash__(self): value = 17 value = (value * 31) ^ hash(self.resourcePlanName) value = (value * 31) ^ hash(self.poolPath) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): @@ -21355,6 +21575,7 @@ class WMCreateOrDropTriggerToPoolMappingRequest: - triggerName - poolPath - drop + - ns """ thrift_spec = ( @@ -21363,13 +21584,15 @@ class WMCreateOrDropTriggerToPoolMappingRequest: (2, TType.STRING, 'triggerName', None, None, ), # 2 (3, TType.STRING, 'poolPath', None, None, ), # 3 (4, TType.BOOL, 'drop', None, None, ), # 4 + (5, TType.STRING, 'ns', None, None, ), # 5 ) - def __init__(self, resourcePlanName=None, triggerName=None, poolPath=None, drop=None,): + def __init__(self, resourcePlanName=None, triggerName=None, poolPath=None, drop=None, ns=None,): self.resourcePlanName = resourcePlanName self.triggerName = triggerName self.poolPath = poolPath self.drop = drop + self.ns = ns def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -21400,6 +21623,11 @@ def read(self, iprot): self.drop = iprot.readBool() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.ns = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -21426,6 +21654,10 @@ def write(self, oprot): oprot.writeFieldBegin('drop', TType.BOOL, 4) oprot.writeBool(self.drop) oprot.writeFieldEnd() + if self.ns is not None: + oprot.writeFieldBegin('ns', TType.STRING, 5) + oprot.writeString(self.ns) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -21439,6 +21671,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.triggerName) value = (value * 31) ^ hash(self.poolPath) value = (value * 31) ^ hash(self.drop) + value = (value * 31) ^ hash(self.ns) return value def __repr__(self): diff --git standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb index 2eea181d85..46973bf39b 100644 --- standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb +++ standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb @@ -4109,12 +4109,14 @@ class WMResourcePlan STATUS = 2 QUERYPARALLELISM = 3 DEFAULTPOOLPATH = 4 + NS = 5 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :optional => true, :enum_class => ::WMResourcePlanStatus}, QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true}, - DEFAULTPOOLPATH => {:type => ::Thrift::Types::STRING, :name => 'defaultPoolPath', :optional => true} + DEFAULTPOOLPATH => {:type => ::Thrift::Types::STRING, :name => 'defaultPoolPath', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4137,6 +4139,7 @@ class WMNullableResourcePlan ISSETQUERYPARALLELISM = 5 DEFAULTPOOLPATH = 6 ISSETDEFAULTPOOLPATH = 7 + NS = 8 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :optional => true}, @@ -4144,7 +4147,8 @@ class WMNullableResourcePlan QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true}, ISSETQUERYPARALLELISM => {:type => ::Thrift::Types::BOOL, :name => 'isSetQueryParallelism', :optional => true}, DEFAULTPOOLPATH => {:type => ::Thrift::Types::STRING, :name => 'defaultPoolPath', :optional => true}, - ISSETDEFAULTPOOLPATH => {:type => ::Thrift::Types::BOOL, :name => 'isSetDefaultPoolPath', :optional => true} + ISSETDEFAULTPOOLPATH => {:type => ::Thrift::Types::BOOL, :name => 'isSetDefaultPoolPath', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4165,13 +4169,15 @@ class WMPool ALLOCFRACTION = 3 QUERYPARALLELISM = 4 SCHEDULINGPOLICY = 5 + NS = 6 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, POOLPATH => {:type => ::Thrift::Types::STRING, :name => 'poolPath'}, ALLOCFRACTION => {:type => ::Thrift::Types::DOUBLE, :name => 'allocFraction', :optional => true}, QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true}, - SCHEDULINGPOLICY => {:type => ::Thrift::Types::STRING, :name => 'schedulingPolicy', :optional => true} + SCHEDULINGPOLICY => {:type => ::Thrift::Types::STRING, :name => 'schedulingPolicy', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4192,6 +4198,7 @@ class WMNullablePool QUERYPARALLELISM = 4 SCHEDULINGPOLICY = 5 ISSETSCHEDULINGPOLICY = 6 + NS = 7 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, @@ -4199,7 +4206,8 @@ class WMNullablePool ALLOCFRACTION => {:type => ::Thrift::Types::DOUBLE, :name => 'allocFraction', :optional => true}, QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true}, SCHEDULINGPOLICY => {:type => ::Thrift::Types::STRING, :name => 'schedulingPolicy', :optional => true}, - ISSETSCHEDULINGPOLICY => {:type => ::Thrift::Types::BOOL, :name => 'isSetSchedulingPolicy', :optional => true} + ISSETSCHEDULINGPOLICY => {:type => ::Thrift::Types::BOOL, :name => 'isSetSchedulingPolicy', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4219,13 +4227,15 @@ class WMTrigger TRIGGEREXPRESSION = 3 ACTIONEXPRESSION = 4 ISINUNMANAGED = 5 + NS = 6 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, TRIGGERNAME => {:type => ::Thrift::Types::STRING, :name => 'triggerName'}, TRIGGEREXPRESSION => {:type => ::Thrift::Types::STRING, :name => 'triggerExpression', :optional => true}, ACTIONEXPRESSION => {:type => ::Thrift::Types::STRING, :name => 'actionExpression', :optional => true}, - ISINUNMANAGED => {:type => ::Thrift::Types::BOOL, :name => 'isInUnmanaged', :optional => true} + ISINUNMANAGED => {:type => ::Thrift::Types::BOOL, :name => 'isInUnmanaged', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4245,13 +4255,15 @@ class WMMapping ENTITYNAME = 3 POOLPATH = 4 ORDERING = 5 + NS = 6 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, ENTITYTYPE => {:type => ::Thrift::Types::STRING, :name => 'entityType'}, ENTITYNAME => {:type => ::Thrift::Types::STRING, :name => 'entityName'}, POOLPATH => {:type => ::Thrift::Types::STRING, :name => 'poolPath', :optional => true}, - ORDERING => {:type => ::Thrift::Types::I32, :name => 'ordering', :optional => true} + ORDERING => {:type => ::Thrift::Types::I32, :name => 'ordering', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4269,10 +4281,12 @@ class WMPoolTrigger include ::Thrift::Struct, ::Thrift::Struct_Union POOL = 1 TRIGGER = 2 + NS = 3 FIELDS = { POOL => {:type => ::Thrift::Types::STRING, :name => 'pool'}, - TRIGGER => {:type => ::Thrift::Types::STRING, :name => 'trigger'} + TRIGGER => {:type => ::Thrift::Types::STRING, :name => 'trigger'}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4346,9 +4360,10 @@ end class WMGetActiveResourcePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union + NS = 1 FIELDS = { - + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4378,9 +4393,11 @@ end class WMGetResourcePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 + NS = 2 FIELDS = { - RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true} + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4409,9 +4426,10 @@ end class WMGetAllResourcePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union + NS = 1 FIELDS = { - + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4445,13 +4463,15 @@ class WMAlterResourcePlanRequest ISENABLEANDACTIVATE = 3 ISFORCEDEACTIVATE = 4 ISREPLACE = 5 + NS = 6 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, RESOURCEPLAN => {:type => ::Thrift::Types::STRUCT, :name => 'resourcePlan', :class => ::WMNullableResourcePlan, :optional => true}, ISENABLEANDACTIVATE => {:type => ::Thrift::Types::BOOL, :name => 'isEnableAndActivate', :optional => true}, ISFORCEDEACTIVATE => {:type => ::Thrift::Types::BOOL, :name => 'isForceDeactivate', :optional => true}, - ISREPLACE => {:type => ::Thrift::Types::BOOL, :name => 'isReplace', :optional => true} + ISREPLACE => {:type => ::Thrift::Types::BOOL, :name => 'isReplace', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4481,9 +4501,11 @@ end class WMValidateResourcePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 + NS = 2 FIELDS = { - RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true} + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4515,9 +4537,11 @@ end class WMDropResourcePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 + NS = 2 FIELDS = { - RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true} + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4609,10 +4633,12 @@ class WMDropTriggerRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 TRIGGERNAME = 2 + NS = 3 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, - TRIGGERNAME => {:type => ::Thrift::Types::STRING, :name => 'triggerName', :optional => true} + TRIGGERNAME => {:type => ::Thrift::Types::STRING, :name => 'triggerName', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4641,9 +4667,11 @@ end class WMGetTriggersForResourePlanRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 + NS = 2 FIELDS = { - RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true} + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4738,10 +4766,12 @@ class WMDropPoolRequest include ::Thrift::Struct, ::Thrift::Struct_Union RESOURCEPLANNAME = 1 POOLPATH = 2 + NS = 3 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, - POOLPATH => {:type => ::Thrift::Types::STRING, :name => 'poolPath', :optional => true} + POOLPATH => {:type => ::Thrift::Types::STRING, :name => 'poolPath', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end @@ -4837,12 +4867,14 @@ class WMCreateOrDropTriggerToPoolMappingRequest TRIGGERNAME = 2 POOLPATH = 3 DROP = 4 + NS = 5 FIELDS = { RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName', :optional => true}, TRIGGERNAME => {:type => ::Thrift::Types::STRING, :name => 'triggerName', :optional => true}, POOLPATH => {:type => ::Thrift::Types::STRING, :name => 'poolPath', :optional => true}, - DROP => {:type => ::Thrift::Types::BOOL, :name => 'drop', :optional => true} + DROP => {:type => ::Thrift::Types::BOOL, :name => 'drop', :optional => true}, + NS => {:type => ::Thrift::Types::STRING, :name => 'ns', :optional => true} } def struct_fields; FIELDS; end diff --git standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index aba63f050b..3ebfbfa1b5 100644 --- standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -51,6 +51,7 @@ import javax.security.auth.login.LoginException; import com.google.common.base.Preconditions; + import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; @@ -3413,34 +3414,39 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFromName) } @Override - public WMFullResourcePlan getResourcePlan(String resourcePlanName) + public WMFullResourcePlan getResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException { WMGetResourcePlanRequest request = new WMGetResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); return client.get_resource_plan(request).getResourcePlan(); } @Override - public List getAllResourcePlans() + public List getAllResourcePlans(String ns) throws NoSuchObjectException, MetaException, TException { WMGetAllResourcePlanRequest request = new WMGetAllResourcePlanRequest(); + request.setNs(ns); return client.get_all_resource_plans(request).getResourcePlans(); } @Override - public void dropResourcePlan(String resourcePlanName) + public void dropResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException { WMDropResourcePlanRequest request = new WMDropResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); client.drop_resource_plan(request); } @Override - public WMFullResourcePlan alterResourcePlan(String resourcePlanName, WMNullableResourcePlan resourcePlan, + public WMFullResourcePlan alterResourcePlan(String resourcePlanName, String ns, + WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean isForceDeactivate, boolean isReplace) throws NoSuchObjectException, InvalidObjectException, MetaException, TException { WMAlterResourcePlanRequest request = new WMAlterResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); request.setResourcePlan(resourcePlan); request.setIsEnableAndActivate(canActivateDisabled); request.setIsForceDeactivate(isForceDeactivate); @@ -3450,15 +3456,18 @@ public WMFullResourcePlan alterResourcePlan(String resourcePlanName, WMNullableR } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException, TException { - return client.get_active_resource_plan(new WMGetActiveResourcePlanRequest()).getResourcePlan(); + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException, TException { + WMGetActiveResourcePlanRequest request = new WMGetActiveResourcePlanRequest(); + request.setNs(ns); + return client.get_active_resource_plan(request).getResourcePlan(); } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName) + public WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException, TException { WMValidateResourcePlanRequest request = new WMValidateResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); return client.validate_resource_plan(request); } @@ -3479,19 +3488,21 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, MetaException, TException { WMDropTriggerRequest request = new WMDropTriggerRequest(); request.setResourcePlanName(resourcePlanName); request.setTriggerName(triggerName); + request.setNs(ns); client.drop_wm_trigger(request); } @Override - public List getTriggersForResourcePlan(String resourcePlan) + public List getTriggersForResourcePlan(String resourcePlan, String ns) throws NoSuchObjectException, MetaException, TException { WMGetTriggersForResourePlanRequest request = new WMGetTriggersForResourePlanRequest(); request.setResourcePlanName(resourcePlan); + request.setNs(ns); return client.get_triggers_for_resourceplan(request).getTriggers(); } @@ -3513,11 +3524,12 @@ public void alterWMPool(WMNullablePool pool, String poolPath) } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, MetaException, TException { WMDropPoolRequest request = new WMDropPoolRequest(); request.setResourcePlanName(resourcePlanName); request.setPoolPath(poolPath); + request.setNs(ns); client.drop_wm_pool(request); } @@ -3540,13 +3552,14 @@ public void dropWMMapping(WMMapping mapping) @Override public void createOrDropTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath, boolean shouldDrop) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, boolean shouldDrop, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException { WMCreateOrDropTriggerToPoolMappingRequest request = new WMCreateOrDropTriggerToPoolMappingRequest(); request.setResourcePlanName(resourcePlanName); request.setTriggerName(triggerName); request.setPoolPath(poolPath); request.setDrop(shouldDrop); + request.setNs(ns); client.create_or_drop_wm_trigger_to_pool_mapping(request); } diff --git standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index d1c0c4d1f6..fa19440ba2 100644 --- standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -3542,22 +3542,22 @@ void addCheckConstraint(List checkConstraints) throws void createResourcePlan(WMResourcePlan resourcePlan, String copyFromName) throws InvalidObjectException, MetaException, TException; - WMFullResourcePlan getResourcePlan(String resourcePlanName) + WMFullResourcePlan getResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException; - List getAllResourcePlans() + List getAllResourcePlans(String ns) throws NoSuchObjectException, MetaException, TException; - void dropResourcePlan(String resourcePlanName) + void dropResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException; - WMFullResourcePlan alterResourcePlan(String resourcePlanName, WMNullableResourcePlan resourcePlan, + WMFullResourcePlan alterResourcePlan(String resourcePlanName, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean isForceDeactivate, boolean isReplace) throws NoSuchObjectException, InvalidObjectException, MetaException, TException; - WMFullResourcePlan getActiveResourcePlan() throws MetaException, TException; + WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException, TException; - WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName) + WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException, TException; void createWMTrigger(WMTrigger trigger) @@ -3566,10 +3566,10 @@ void createWMTrigger(WMTrigger trigger) void alterWMTrigger(WMTrigger trigger) throws NoSuchObjectException, InvalidObjectException, MetaException, TException; - void dropWMTrigger(String resourcePlanName, String triggerName) + void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, MetaException, TException; - List getTriggersForResourcePlan(String resourcePlan) + List getTriggersForResourcePlan(String resourcePlan, String ns) throws NoSuchObjectException, MetaException, TException; void createWMPool(WMPool pool) @@ -3578,7 +3578,7 @@ void createWMPool(WMPool pool) void alterWMPool(WMNullablePool pool, String poolPath) throws NoSuchObjectException, InvalidObjectException, TException; - void dropWMPool(String resourcePlanName, String poolPath) + void dropWMPool(String resourcePlanName, String poolPath, String ns) throws TException; void createOrUpdateWMMapping(WMMapping mapping, boolean isUpdate) @@ -3588,7 +3588,7 @@ void dropWMMapping(WMMapping mapping) throws TException; void createOrDropTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath, boolean shouldDrop) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, boolean shouldDrop, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException; /** diff --git standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift index 4b7b61520a..48b633e5fa 100644 --- standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift +++ standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift @@ -1343,6 +1343,7 @@ struct WMResourcePlan { 2: optional WMResourcePlanStatus status; 3: optional i32 queryParallelism; 4: optional string defaultPoolPath; + 5: optional string ns; } struct WMNullableResourcePlan { @@ -1352,6 +1353,7 @@ struct WMNullableResourcePlan { 5: optional bool isSetQueryParallelism; 6: optional string defaultPoolPath; 7: optional bool isSetDefaultPoolPath; + 8: optional string ns; } struct WMPool { @@ -1360,6 +1362,7 @@ struct WMPool { 3: optional double allocFraction; 4: optional i32 queryParallelism; 5: optional string schedulingPolicy; + 6: optional string ns; } @@ -1370,6 +1373,7 @@ struct WMNullablePool { 4: optional i32 queryParallelism; 5: optional string schedulingPolicy; 6: optional bool isSetSchedulingPolicy; + 7: optional string ns; } struct WMTrigger { @@ -1378,6 +1382,7 @@ struct WMTrigger { 3: optional string triggerExpression; 4: optional string actionExpression; 5: optional bool isInUnmanaged; + 6: optional string ns; } struct WMMapping { @@ -1386,11 +1391,13 @@ struct WMMapping { 3: required string entityName; 4: optional string poolPath; 5: optional i32 ordering; + 6: optional string ns; } struct WMPoolTrigger { 1: required string pool; 2: required string trigger; + 3: optional string ns; } struct WMFullResourcePlan { @@ -1412,6 +1419,7 @@ struct WMCreateResourcePlanResponse { } struct WMGetActiveResourcePlanRequest { + 1: optional string ns; } struct WMGetActiveResourcePlanResponse { @@ -1420,6 +1428,7 @@ struct WMGetActiveResourcePlanResponse { struct WMGetResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMGetResourcePlanResponse { @@ -1427,6 +1436,7 @@ struct WMGetResourcePlanResponse { } struct WMGetAllResourcePlanRequest { + 1: optional string ns; } struct WMGetAllResourcePlanResponse { @@ -1439,6 +1449,7 @@ struct WMAlterResourcePlanRequest { 3: optional bool isEnableAndActivate; 4: optional bool isForceDeactivate; 5: optional bool isReplace; + 6: optional string ns; } struct WMAlterResourcePlanResponse { @@ -1447,6 +1458,7 @@ struct WMAlterResourcePlanResponse { struct WMValidateResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMValidateResourcePlanResponse { @@ -1456,6 +1468,7 @@ struct WMValidateResourcePlanResponse { struct WMDropResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMDropResourcePlanResponse { @@ -1478,6 +1491,7 @@ struct WMAlterTriggerResponse { struct WMDropTriggerRequest { 1: optional string resourcePlanName; 2: optional string triggerName; + 3: optional string ns; } struct WMDropTriggerResponse { @@ -1485,6 +1499,7 @@ struct WMDropTriggerResponse { struct WMGetTriggersForResourePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMGetTriggersForResourePlanResponse { @@ -1509,6 +1524,7 @@ struct WMAlterPoolResponse { struct WMDropPoolRequest { 1: optional string resourcePlanName; 2: optional string poolPath; + 3: optional string ns; } struct WMDropPoolResponse { @@ -1534,6 +1550,7 @@ struct WMCreateOrDropTriggerToPoolMappingRequest { 2: optional string triggerName; 3: optional string poolPath; 4: optional bool drop; + 5: optional string ns; } struct WMCreateOrDropTriggerToPoolMappingResponse { diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 8cd46e3f44..0485184554 100644 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -8200,7 +8200,7 @@ public WMCreateResourcePlanResponse create_resource_plan(WMCreateResourcePlanReq public WMGetResourcePlanResponse get_resource_plan(WMGetResourcePlanRequest request) throws NoSuchObjectException, MetaException, TException { try { - WMFullResourcePlan rp = getMS().getResourcePlan(request.getResourcePlanName()); + WMFullResourcePlan rp = getMS().getResourcePlan(request.getResourcePlanName(), request.getNs()); WMGetResourcePlanResponse resp = new WMGetResourcePlanResponse(); resp.setResourcePlan(rp); return resp; @@ -8215,7 +8215,7 @@ public WMGetAllResourcePlanResponse get_all_resource_plans(WMGetAllResourcePlanR throws MetaException, TException { try { WMGetAllResourcePlanResponse resp = new WMGetAllResourcePlanResponse(); - resp.setResourcePlans(getMS().getAllResourcePlans()); + resp.setResourcePlans(getMS().getAllResourcePlans(request.getNs())); return resp; } catch (MetaException e) { LOG.error("Exception while trying to retrieve resource plans", e); @@ -8235,7 +8235,7 @@ public WMAlterResourcePlanResponse alter_resource_plan(WMAlterResourcePlanReques // This method will only return full resource plan when activating one, // to give the caller the result atomically with the activation. WMFullResourcePlan fullPlanAfterAlter = getMS().alterResourcePlan( - request.getResourcePlanName(), request.getResourcePlan(), + request.getResourcePlanName(), request.getNs(), request.getResourcePlan(), request.isIsEnableAndActivate(), request.isIsForceDeactivate(), request.isIsReplace()); if (fullPlanAfterAlter != null) { response.setFullResourcePlan(fullPlanAfterAlter); @@ -8252,7 +8252,7 @@ public WMGetActiveResourcePlanResponse get_active_resource_plan( WMGetActiveResourcePlanRequest request) throws MetaException, TException { try { WMGetActiveResourcePlanResponse response = new WMGetActiveResourcePlanResponse(); - response.setResourcePlan(getMS().getActiveResourcePlan()); + response.setResourcePlan(getMS().getActiveResourcePlan(request.getNs())); return response; } catch (MetaException e) { LOG.error("Exception while trying to get active resource plan", e); @@ -8264,7 +8264,7 @@ public WMGetActiveResourcePlanResponse get_active_resource_plan( public WMValidateResourcePlanResponse validate_resource_plan(WMValidateResourcePlanRequest request) throws NoSuchObjectException, MetaException, TException { try { - return getMS().validateResourcePlan(request.getResourcePlanName()); + return getMS().validateResourcePlan(request.getResourcePlanName(), request.getNs()); } catch (MetaException e) { LOG.error("Exception while trying to validate resource plan", e); throw e; @@ -8275,7 +8275,7 @@ public WMValidateResourcePlanResponse validate_resource_plan(WMValidateResourceP public WMDropResourcePlanResponse drop_resource_plan(WMDropResourcePlanRequest request) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { try { - getMS().dropResourcePlan(request.getResourcePlanName()); + getMS().dropResourcePlan(request.getResourcePlanName(), request.getNs()); return new WMDropResourcePlanResponse(); } catch (MetaException e) { LOG.error("Exception while trying to drop resource plan", e); @@ -8311,7 +8311,7 @@ public WMAlterTriggerResponse alter_wm_trigger(WMAlterTriggerRequest request) public WMDropTriggerResponse drop_wm_trigger(WMDropTriggerRequest request) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { try { - getMS().dropWMTrigger(request.getResourcePlanName(), request.getTriggerName()); + getMS().dropWMTrigger(request.getResourcePlanName(), request.getTriggerName(), request.getNs()); return new WMDropTriggerResponse(); } catch (MetaException e) { LOG.error("Exception while trying to drop trigger.", e); @@ -8325,7 +8325,7 @@ public WMGetTriggersForResourePlanResponse get_triggers_for_resourceplan( throws NoSuchObjectException, MetaException, TException { try { List triggers = - getMS().getTriggersForResourcePlan(request.getResourcePlanName()); + getMS().getTriggersForResourcePlan(request.getResourcePlanName(), request.getNs()); WMGetTriggersForResourePlanResponse response = new WMGetTriggersForResourePlanResponse(); response.setTriggers(triggers); return response; @@ -8365,7 +8365,7 @@ public WMCreatePoolResponse create_wm_pool(WMCreatePoolRequest request) public WMDropPoolResponse drop_wm_pool(WMDropPoolRequest request) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { try { - getMS().dropWMPool(request.getResourcePlanName(), request.getPoolPath()); + getMS().dropWMPool(request.getResourcePlanName(), request.getPoolPath(), request.getNs()); return new WMDropPoolResponse(); } catch (MetaException e) { LOG.error("Exception while trying to drop WMPool", e); @@ -8404,11 +8404,11 @@ public WMCreateOrDropTriggerToPoolMappingResponse create_or_drop_wm_trigger_to_p NoSuchObjectException, InvalidObjectException, MetaException, TException { try { if (request.isDrop()) { - getMS().dropWMTriggerToPoolMapping( - request.getResourcePlanName(), request.getTriggerName(), request.getPoolPath()); + getMS().dropWMTriggerToPoolMapping(request.getResourcePlanName(), + request.getTriggerName(), request.getPoolPath(), request.getNs()); } else { - getMS().createWMTriggerToPoolMapping( - request.getResourcePlanName(), request.getTriggerName(), request.getPoolPath()); + getMS().createWMTriggerToPoolMapping(request.getResourcePlanName(), + request.getTriggerName(), request.getPoolPath(), request.getNs()); } return new WMCreateOrDropTriggerToPoolMappingResponse(); } catch (MetaException e) { diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 9c15804049..37e6223b37 100644 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -11593,13 +11593,15 @@ public void createResourcePlan( } else { rp = new MWMResourcePlan(rpName, null, Status.DISABLED); } + rp.setNs(resourcePlan.getNs()); try { openTransaction(); pm.makePersistent(rp); if (copyFromName != null) { - MWMResourcePlan copyFrom = getMWMResourcePlan(copyFromName, false); + String ns = getNsOrDefault(resourcePlan.getNs()); + MWMResourcePlan copyFrom = getMWMResourcePlan(copyFromName, ns, false); if (copyFrom == null) { - throw new NoSuchObjectException(copyFromName); + throw new NoSuchObjectException(copyFromName + " in " + ns); } copyRpContents(rp, copyFrom); } else { @@ -11627,6 +11629,7 @@ public void createResourcePlan( private void copyRpContents(MWMResourcePlan dest, MWMResourcePlan src) { dest.setQueryParallelism(src.getQueryParallelism()); + dest.setNs(src.getNs()); Map pools = new HashMap<>(); Map> triggersToPools = new HashMap<>(); for (MWMPool copyPool : src.getPools()) { @@ -11686,6 +11689,7 @@ private WMResourcePlan fromMResourcePlan(MWMResourcePlan mplan) { } WMResourcePlan rp = new WMResourcePlan(); rp.setName(mplan.getName()); + rp.setNs(mplan.getNs()); rp.setStatus(WMResourcePlanStatus.valueOf(mplan.getStatus().name())); if (mplan.getQueryParallelism() != null) { rp.setQueryParallelism(mplan.getQueryParallelism()); @@ -11724,6 +11728,7 @@ private WMPool fromMPool(MWMPool mPool, String rpName) { assert mPool.getQueryParallelism() != null; result.setQueryParallelism(mPool.getQueryParallelism()); result.setSchedulingPolicy(mPool.getSchedulingPolicy()); + result.setNs(mPool.getResourcePlan().getNs()); return result; } @@ -11736,15 +11741,24 @@ private WMMapping fromMMapping(MWMMapping mMapping, String rpName) { if (mMapping.getOrdering() != null) { result.setOrdering(mMapping.getOrdering()); } + result.setNs(mMapping.getResourcePlan().getNs()); return result; } + private final String getNsOrDefault(String ns) { + // This is only needed for old clients not setting NS in requests. + // Not clear how to handle this... this is properly a HS2 config but metastore needs its default + // value for backward compat, and we don't want it configurable separately because it's also + // used in upgrade scripts, were it cannot be configured. + return normalizeIdentifier(ns == null ? "default" : ns); + } + @Override - public WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectException { + public WMFullResourcePlan getResourcePlan(String name, String ns) throws NoSuchObjectException { boolean commited = false; try { openTransaction(); - WMFullResourcePlan fullRp = fullFromMResourcePlan(getMWMResourcePlan(name, false)); + WMFullResourcePlan fullRp = fullFromMResourcePlan(getMWMResourcePlan(name, ns, false)); commited = commitTransaction(); return fullRp; } catch (InvalidOperationException e) { @@ -11755,12 +11769,12 @@ public WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectExcept } } - private MWMResourcePlan getMWMResourcePlan(String name, boolean editCheck) + private MWMResourcePlan getMWMResourcePlan(String name, String ns, boolean editCheck) throws NoSuchObjectException, InvalidOperationException { - return getMWMResourcePlan(name, editCheck, true); + return getMWMResourcePlan(name, ns, editCheck, true); } - private MWMResourcePlan getMWMResourcePlan(String name, boolean editCheck, boolean mustExist) + private MWMResourcePlan getMWMResourcePlan(String name, String ns, boolean editCheck, boolean mustExist) throws NoSuchObjectException, InvalidOperationException { MWMResourcePlan resourcePlan; boolean commited = false; @@ -11768,18 +11782,16 @@ private MWMResourcePlan getMWMResourcePlan(String name, boolean editCheck, boole name = normalizeIdentifier(name); try { - openTransaction(); - query = pm.newQuery(MWMResourcePlan.class, "name == rpname"); - query.declareParameters("java.lang.String rpname"); - query.setUnique(true); - resourcePlan = (MWMResourcePlan) query.execute(name); + query = createGetResourcePlanQuery(); + ns = getNsOrDefault(ns); + resourcePlan = (MWMResourcePlan) query.execute(name, ns); pm.retrieve(resourcePlan); commited = commitTransaction(); } finally { rollbackAndCleanup(commited, query); } if (mustExist && resourcePlan == null) { - throw new NoSuchObjectException("There is no resource plan named: " + name); + throw new NoSuchObjectException("There is no resource plan named: " + name + " in " + ns); } if (editCheck && resourcePlan != null && resourcePlan.getStatus() != MWMResourcePlan.Status.DISABLED) { @@ -11788,15 +11800,24 @@ private MWMResourcePlan getMWMResourcePlan(String name, boolean editCheck, boole return resourcePlan; } + private Query createGetResourcePlanQuery() { + openTransaction(); + Query query = pm.newQuery(MWMResourcePlan.class, "name == rpname && ns == nsname"); + query.declareParameters("java.lang.String rpname, java.lang.String nsname"); + query.setUnique(true); + return query; + } + @Override - public List getAllResourcePlans() throws MetaException { + public List getAllResourcePlans(String ns) throws MetaException { List resourcePlans = new ArrayList(); boolean commited = false; Query query = null; try { openTransaction(); - query = pm.newQuery(MWMResourcePlan.class); - List mplans = (List) query.execute(); + query = pm.newQuery(MWMResourcePlan.class, "ns == nsname"); + query.declareParameters("java.lang.String nsname"); + List mplans = (List) query.execute(getNsOrDefault(ns)); pm.retrieveAll(mplans); commited = commitTransaction(); if (mplans != null) { @@ -11811,7 +11832,7 @@ private MWMResourcePlan getMWMResourcePlan(String name, boolean editCheck, boole } @Override - public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan changes, + public WMFullResourcePlan alterResourcePlan(String name, String ns, WMNullableResourcePlan changes, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { name = name == null ? null : normalizeIdentifier(name); @@ -11827,9 +11848,9 @@ public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan try { openTransaction(); if (isReplace) { - result = handleAlterReplace(name, changes); + result = handleAlterReplace(name, ns, changes); } else { - result = handleSimpleAlter(name, changes, canActivateDisabled, canDeactivate); + result = handleSimpleAlter(name, ns, changes, canActivateDisabled, canDeactivate); } commited = commitTransaction(); @@ -11842,11 +11863,16 @@ public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan } } - private WMFullResourcePlan handleSimpleAlter(String name, WMNullableResourcePlan changes, + private WMFullResourcePlan handleSimpleAlter(String name, String ns, WMNullableResourcePlan changes, boolean canActivateDisabled, boolean canDeactivate) throws InvalidOperationException, NoSuchObjectException, MetaException { - MWMResourcePlan plan = name == null ? getActiveMWMResourcePlan() - : getMWMResourcePlan(name, !changes.isSetStatus()); + MWMResourcePlan plan = name == null ? getActiveMWMResourcePlan(ns) + : getMWMResourcePlan(name, ns, !changes.isSetStatus()); + boolean hasNsChange = changes.isSetNs() && !changes.getNs().equals(getNsOrDefault(plan.getNs())); + if (hasNsChange) { + throw new InvalidOperationException("Cannot change ns; from " + getNsOrDefault(plan.getNs()) + + " to " + changes.getNs()); + } boolean hasNameChange = changes.isSetName() && !changes.getName().equals(name); // Verify that field changes are consistent with what Hive does. Note: we could handle this. if (changes.isSetIsSetQueryParallelism() @@ -11895,7 +11921,7 @@ private WMFullResourcePlan handleSimpleAlter(String name, WMNullableResourcePlan return null; } - private WMFullResourcePlan handleAlterReplace(String name, WMNullableResourcePlan changes) + private WMFullResourcePlan handleAlterReplace(String name, String ns, WMNullableResourcePlan changes) throws InvalidOperationException, NoSuchObjectException, MetaException { // Verify that field changes are consistent with what Hive does. Note: we could handle this. if (changes.isSetQueryParallelism() || changes.isSetDefaultPoolPath()) { @@ -11911,19 +11937,26 @@ private WMFullResourcePlan handleAlterReplace(String name, WMNullableResourcePla if (name == null) { throw new InvalidOperationException("Invalid replace - no name specified"); } + ns = getNsOrDefault(ns); MWMResourcePlan replacedPlan = isReplacingSpecific - ? getMWMResourcePlan(changes.getName(), false) : getActiveMWMResourcePlan(); - MWMResourcePlan plan = getMWMResourcePlan(name, false); + ? getMWMResourcePlan(changes.getName(), ns, false) : getActiveMWMResourcePlan(ns); + MWMResourcePlan plan = getMWMResourcePlan(name, ns, false); if (replacedPlan.getName().equals(plan.getName())) { throw new InvalidOperationException("A plan cannot replace itself"); } + String oldNs = getNsOrDefault(replacedPlan.getNs()), newNs = getNsOrDefault(plan.getNs()); + if (!oldNs.equals(newNs)) { + throw new InvalidOperationException("Cannot change the namespace; replacing " + + oldNs + " with " + newNs); + } + // We will inherit the name and status from the plan we are replacing. String newName = replacedPlan.getName(); int i = 0; String copyName = generateOldPlanName(newName, i); while (true) { - MWMResourcePlan dup = getMWMResourcePlan(copyName, false, false); + MWMResourcePlan dup = getMWMResourcePlan(copyName, ns, false, false); if (dup == null) { break; } @@ -11950,18 +11983,16 @@ private String generateOldPlanName(String newName, int i) { } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException { + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException { // Note: fullFromMResroucePlan needs to be called inside the txn, otherwise we could have // deduplicated this with getActiveMWMResourcePlan. boolean commited = false; Query query = null; WMFullResourcePlan result = null; try { - openTransaction(); - query = pm.newQuery(MWMResourcePlan.class, "status == activeStatus"); - query.declareParameters("java.lang.String activeStatus"); - query.setUnique(true); - MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute(Status.ACTIVE.toString()); + query = createActivePlanQuery(); + MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute( + Status.ACTIVE.toString(), getNsOrDefault(ns)); if (mResourcePlan != null) { result = fullFromMResourcePlan(mResourcePlan); } @@ -11972,16 +12003,14 @@ public WMFullResourcePlan getActiveResourcePlan() throws MetaException { return result; } - private MWMResourcePlan getActiveMWMResourcePlan() throws MetaException { + private MWMResourcePlan getActiveMWMResourcePlan(String ns) throws MetaException { boolean commited = false; Query query = null; MWMResourcePlan result = null; try { - openTransaction(); - query = pm.newQuery(MWMResourcePlan.class, "status == activeStatus"); - query.declareParameters("java.lang.String activeStatus"); - query.setUnique(true); - result = (MWMResourcePlan) query.execute(Status.ACTIVE.toString()); + query = createActivePlanQuery(); + result = (MWMResourcePlan) query.execute( + Status.ACTIVE.toString(), getNsOrDefault(ns)); pm.retrieve(result); commited = commitTransaction(); } finally { @@ -11990,6 +12019,14 @@ private MWMResourcePlan getActiveMWMResourcePlan() throws MetaException { return result; } + private Query createActivePlanQuery() { + openTransaction(); + Query query = pm.newQuery(MWMResourcePlan.class, "status == activeStatus && ns == nsname"); + query.declareParameters("java.lang.String activeStatus, java.lang.String nsname"); + query.setUnique(true); + return query; + } + private WMFullResourcePlan switchStatus(String name, MWMResourcePlan mResourcePlan, String status, boolean canActivateDisabled, boolean canDeactivate) throws InvalidOperationException { Status currentStatus = mResourcePlan.getStatus(); @@ -12018,7 +12055,7 @@ private WMFullResourcePlan switchStatus(String name, MWMResourcePlan mResourcePl doValidate = true; doActivate = (newStatus == Status.ACTIVE); if (doActivate && !canActivateDisabled) { - throw new InvalidOperationException("Resource plan " +name + throw new InvalidOperationException("Resource plan " + name + " is disabled and should be enabled before activation (or in the same command)"); } break; @@ -12043,7 +12080,7 @@ private WMFullResourcePlan switchStatus(String name, MWMResourcePlan mResourcePl } if (doActivate) { // Deactivate currently active resource plan. - deactivateActiveResourcePlan(); + deactivateActiveResourcePlan(mResourcePlan.getNs()); mResourcePlan.setStatus(newStatus); return fullFromMResourcePlan(mResourcePlan); } else { @@ -12052,14 +12089,13 @@ private WMFullResourcePlan switchStatus(String name, MWMResourcePlan mResourcePl return null; } - private void deactivateActiveResourcePlan() { + private void deactivateActiveResourcePlan(String ns) { boolean commited = false; Query query = null; try { - openTransaction(); - query = pm.newQuery(MWMResourcePlan.class, "status == \"ACTIVE\""); - query.setUnique(true); - MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute(); + query = createActivePlanQuery(); + MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute( + Status.ACTIVE.toString(), getNsOrDefault(ns)); // We may not have an active resource plan in the start. if (mResourcePlan != null) { mResourcePlan.setStatus(Status.ENABLED); @@ -12151,19 +12187,16 @@ private WMValidateResourcePlanResponse getResourcePlanErrors(MWMResourcePlan mRe } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String name) + public WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException { name = normalizeIdentifier(name); Query query = null; try { - query = pm.newQuery(MWMResourcePlan.class, "name == rpName"); - query.declareParameters("java.lang.String rpName"); - query.setUnique(true); - MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute(name); + query = createGetResourcePlanQuery(); + MWMResourcePlan mResourcePlan = (MWMResourcePlan) query.execute(name, getNsOrDefault(ns)); if (mResourcePlan == null) { - throw new NoSuchObjectException("Cannot find resourcePlan: " + name); + throw new NoSuchObjectException("Cannot find resourcePlan: " + name + " in " + ns); } - // Validate resource plan. return getResourcePlanErrors(mResourcePlan); } finally { rollbackAndCleanup(true, query); @@ -12171,19 +12204,16 @@ public WMValidateResourcePlanResponse validateResourcePlan(String name) } @Override - public void dropResourcePlan(String name) throws NoSuchObjectException, MetaException { + public void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { name = normalizeIdentifier(name); boolean commited = false; Query query = null; try { - openTransaction(); - query = pm.newQuery(MWMResourcePlan.class, "name == rpname"); - query.declareParameters("java.lang.String rpname"); - query.setUnique(true); - MWMResourcePlan resourcePlan = (MWMResourcePlan) query.execute(name); - pm.retrieve(resourcePlan); + query = createGetResourcePlanQuery(); + MWMResourcePlan resourcePlan = (MWMResourcePlan) query.execute(name, getNsOrDefault(ns)); + pm.retrieve(resourcePlan); // TODO: why do some codepaths call retrieve and some don't? if (resourcePlan == null) { - throw new NoSuchObjectException("There is no resource plan named: " + name); + throw new NoSuchObjectException("There is no resource plan named: " + name + " in " + ns); } if (resourcePlan.getStatus() == Status.ACTIVE) { throw new MetaException("Cannot drop an active resource plan"); @@ -12207,7 +12237,8 @@ public void createWMTrigger(WMTrigger trigger) boolean commited = false; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(trigger.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + trigger.getResourcePlanName(), trigger.getNs(), true); MWMTrigger mTrigger = new MWMTrigger(resourcePlan, normalizeIdentifier(trigger.getTriggerName()), trigger.getTriggerExpression(), trigger.getActionExpression(), null, @@ -12229,7 +12260,8 @@ public void alterWMTrigger(WMTrigger trigger) Query query = null; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(trigger.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + trigger.getResourcePlanName(), trigger.getNs(), true); MWMTrigger mTrigger = getTrigger(resourcePlan, trigger.getTriggerName()); // Update the object. if (trigger.isSetTriggerExpression()) { @@ -12271,7 +12303,7 @@ private MWMTrigger getTrigger(MWMResourcePlan resourcePlan, String triggerName) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { resourcePlanName = normalizeIdentifier(resourcePlanName); triggerName = normalizeIdentifier(triggerName); @@ -12280,7 +12312,7 @@ public void dropWMTrigger(String resourcePlanName, String triggerName) Query query = null; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, true); + MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, ns, true); query = pm.newQuery(MWMTrigger.class, "resourcePlan == rp && name == triggerName"); query.declareParameters("MWMResourcePlan rp, java.lang.String triggerName"); if (query.deletePersistentAll(resourcePlan, triggerName) != 1) { @@ -12293,7 +12325,7 @@ public void dropWMTrigger(String resourcePlanName, String triggerName) } @Override - public List getTriggersForResourcePlan(String resourcePlanName) + public List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException { List triggers = new ArrayList(); boolean commited = false; @@ -12302,7 +12334,7 @@ public void dropWMTrigger(String resourcePlanName, String triggerName) openTransaction(); MWMResourcePlan resourcePlan; try { - resourcePlan = getMWMResourcePlan(resourcePlanName, false); + resourcePlan = getMWMResourcePlan(resourcePlanName, ns, false); } catch (InvalidOperationException e) { // Should not happen, edit check is false. throw new RuntimeException(e); @@ -12330,6 +12362,7 @@ private WMTrigger fromMWMTrigger(MWMTrigger mTrigger, String resourcePlanName) { trigger.setTriggerExpression(mTrigger.getTriggerExpression()); trigger.setActionExpression(mTrigger.getActionExpression()); trigger.setIsInUnmanaged(mTrigger.getIsInUnmanaged()); + trigger.setNs(mTrigger.getResourcePlan().getNs()); return trigger; } @@ -12339,7 +12372,8 @@ public void createPool(WMPool pool) throws AlreadyExistsException, NoSuchObjectE boolean commited = false; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(pool.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + pool.getResourcePlanName(), pool.getNs(), true); if (!poolParentExists(resourcePlan, pool.getPoolPath())) { throw new NoSuchObjectException("Pool path is invalid, the parent does not exist"); @@ -12366,7 +12400,8 @@ public void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExists boolean commited = false; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(pool.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + pool.getResourcePlanName(), pool.getNs(), true); MWMPool mPool = getPool(resourcePlan, poolPath); pm.retrieve(mPool); if (pool.isSetAllocFraction()) { @@ -12463,20 +12498,20 @@ private boolean poolParentExists(MWMResourcePlan resourcePlan, String poolPath) } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { poolPath = normalizeIdentifier(poolPath); boolean commited = false; Query query = null; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, true); + MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, ns, true); if (resourcePlan.getDefaultPool() != null && resourcePlan.getDefaultPool().getPath().equals(poolPath)) { throw new InvalidOperationException("Cannot drop default pool of a resource plan"); } if (poolHasChildren(resourcePlan, poolPath)) { - throw new InvalidOperationException("Pool has children cannot drop."); + throw new InvalidOperationException("Cannot drop a pool that has child pools"); } query = pm.newQuery(MWMPool.class, "resourcePlan == rp && path.startsWith(poolPath)"); query.declareParameters("MWMResourcePlan rp, java.lang.String poolPath"); @@ -12521,7 +12556,8 @@ public void createOrUpdateWMMapping(WMMapping mapping, boolean update) Query query = null; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(mapping.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + mapping.getResourcePlanName(), mapping.getNs(), true); MWMPool pool = null; if (mapping.isSetPoolPath()) { pool = getPool(resourcePlan, mapping.getPoolPath()); @@ -12555,7 +12591,8 @@ public void dropWMMapping(WMMapping mapping) Query query = null; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(mapping.getResourcePlanName(), true); + MWMResourcePlan resourcePlan = getMWMResourcePlan( + mapping.getResourcePlanName(), mapping.getNs(), true); query = pm.newQuery(MWMMapping.class, "resourcePlan == rp && entityType == type && entityName == name"); query.declareParameters("MWMResourcePlan rp, java.lang.String type, java.lang.String name"); @@ -12570,12 +12607,12 @@ public void dropWMMapping(WMMapping mapping) @Override public void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { boolean commited = false; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, true); + MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, ns, true); MWMPool pool = getPool(resourcePlan, poolPath); MWMTrigger trigger = getTrigger(resourcePlan, triggerName); pool.getTriggers().add(trigger); @@ -12590,11 +12627,11 @@ public void createWMTriggerToPoolMapping(String resourcePlanName, String trigger @Override public void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws NoSuchObjectException, InvalidOperationException, MetaException { + String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { boolean commited = false; try { openTransaction(); - MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, true); + MWMResourcePlan resourcePlan = getMWMResourcePlan(resourcePlanName, ns, true); MWMPool pool = getPool(resourcePlan, poolPath); MWMTrigger trigger = getTrigger(resourcePlan, triggerName); pool.getTriggers().remove(trigger); diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java index c3914b668f..209e92a415 100644 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java @@ -20,12 +20,6 @@ import org.apache.hadoop.hive.common.TableName; import org.apache.hadoop.hive.metastore.api.*; -import org.apache.hadoop.hive.metastore.api.CreationMetadata; -import org.apache.hadoop.hive.metastore.api.ISchemaName; -import org.apache.hadoop.hive.metastore.api.Partition; -import org.apache.hadoop.hive.metastore.api.SchemaVersionDescriptor; -import org.apache.hadoop.hive.metastore.api.WMFullResourcePlan; -import org.apache.hadoop.hive.metastore.api.WriteEventInfo; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -1546,21 +1540,21 @@ void dropConstraint(String catName, String dbName, String tableName, String cons void createResourcePlan(WMResourcePlan resourcePlan, String copyFrom, int defaultPoolSize) throws AlreadyExistsException, MetaException, InvalidObjectException, NoSuchObjectException; - WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectException, MetaException; + WMFullResourcePlan getResourcePlan(String name, String string) throws NoSuchObjectException, MetaException; - List getAllResourcePlans() throws MetaException; + List getAllResourcePlans(String string) throws MetaException; - WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan resourcePlan, + WMFullResourcePlan alterResourcePlan(String name, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException; - WMFullResourcePlan getActiveResourcePlan() throws MetaException; + WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException; - WMValidateResourcePlanResponse validateResourcePlan(String name) + WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException; - void dropResourcePlan(String name) throws NoSuchObjectException, MetaException; + void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException; void createWMTrigger(WMTrigger trigger) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, @@ -1569,10 +1563,10 @@ void createWMTrigger(WMTrigger trigger) void alterWMTrigger(WMTrigger trigger) throws NoSuchObjectException, InvalidOperationException, MetaException; - void dropWMTrigger(String resourcePlanName, String triggerName) + void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException; - List getTriggersForResourcePlan(String resourcePlanName) + List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException; void createPool(WMPool pool) throws AlreadyExistsException, NoSuchObjectException, @@ -1581,7 +1575,7 @@ void createPool(WMPool pool) throws AlreadyExistsException, NoSuchObjectExceptio void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException; - void dropWMPool(String resourcePlanName, String poolPath) + void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException; void createOrUpdateWMMapping(WMMapping mapping, boolean update) @@ -1591,11 +1585,11 @@ void createOrUpdateWMMapping(WMMapping mapping, boolean update) void dropWMMapping(WMMapping mapping) throws NoSuchObjectException, InvalidOperationException, MetaException; - void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, String poolPath) + void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException; - void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, String poolPath) + void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException; /** diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java index 47ac68c667..e4ef46fdb4 100644 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java @@ -1644,7 +1644,7 @@ public Partition getPartitionWithAuth(String catName, String dbName, String tblN } return partitions; } - + private String getPartNameMatcher(Table table, List partSpecs) throws MetaException { List partCols = table.getPartitionKeys(); int numPartKeys = partCols.size(); @@ -2407,39 +2407,39 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFrom, int } @Override - public WMFullResourcePlan getResourcePlan(String name) + public WMFullResourcePlan getResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { - return rawStore.getResourcePlan(name); + return rawStore.getResourcePlan(name, ns); } @Override - public List getAllResourcePlans() throws MetaException { - return rawStore.getAllResourcePlans(); + public List getAllResourcePlans(String ns) throws MetaException { + return rawStore.getAllResourcePlans(ns); } @Override - public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan resourcePlan, + public WMFullResourcePlan alterResourcePlan(String name, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { return rawStore.alterResourcePlan( - name, resourcePlan, canActivateDisabled, canDeactivate, isReplace); + name, ns, resourcePlan, canActivateDisabled, canDeactivate, isReplace); } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException { - return rawStore.getActiveResourcePlan(); + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException { + return rawStore.getActiveResourcePlan(ns); } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String name) + public WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException { - return rawStore.validateResourcePlan(name); + return rawStore.validateResourcePlan(name, ns); } @Override - public void dropResourcePlan(String name) throws NoSuchObjectException, MetaException { - rawStore.dropResourcePlan(name); + public void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { + rawStore.dropResourcePlan(name, ns); } @Override @@ -2456,15 +2456,15 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - rawStore.dropWMTrigger(resourcePlanName, triggerName); + rawStore.dropWMTrigger(resourcePlanName, triggerName, ns); } @Override - public List getTriggersForResourcePlan(String resourcePlanName) + public List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException { - return rawStore.getTriggersForResourcePlan(resourcePlanName); + return rawStore.getTriggersForResourcePlan(resourcePlanName, ns); } @Override @@ -2480,9 +2480,9 @@ public void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExists } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - rawStore.dropWMPool(resourcePlanName, poolPath); + rawStore.dropWMPool(resourcePlanName, poolPath, ns); } @Override @@ -2500,15 +2500,15 @@ public void dropWMMapping(WMMapping mapping) @Override public void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { - rawStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + rawStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } @Override public void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws NoSuchObjectException, InvalidOperationException, MetaException { - rawStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { + rawStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } public long getCacheUpdateCount() { diff --git standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java index ac51f2d771..648587e5bf 100644 --- standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java +++ standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java @@ -25,6 +25,7 @@ */ public class MWMResourcePlan { private String name; + private String ns; private Integer queryParallelism; private Status status; private Set pools; @@ -51,6 +52,14 @@ public String getName() { return name; } + public void setNs(String name) { + this.ns = name; + } + + public String getNs() { + return ns; + } + public void setName(String name) { this.name = name; } diff --git standalone-metastore/metastore-server/src/main/resources/package.jdo standalone-metastore/metastore-server/src/main/resources/package.jdo index fef6a42038..01306e6fab 100644 --- standalone-metastore/metastore-server/src/main/resources/package.jdo +++ standalone-metastore/metastore-server/src/main/resources/package.jdo @@ -1230,6 +1230,9 @@ + + + @@ -1241,6 +1244,7 @@ + diff --git standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql index c889bbdf96..a3c4196dbf 100644 --- standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql +++ standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql @@ -182,7 +182,7 @@ CREATE TABLE "APP"."KEY_CONSTRAINTS" ("CHILD_CD_ID" BIGINT, "CHILD_INTEGER_IDX" CREATE TABLE "APP"."METASTORE_DB_PROPERTIES" ("PROPERTY_KEY" VARCHAR(255) NOT NULL, "PROPERTY_VALUE" VARCHAR(1000) NOT NULL, "DESCRIPTION" VARCHAR(1000)); -CREATE TABLE "APP"."WM_RESOURCEPLAN" (RP_ID BIGINT NOT NULL, NAME VARCHAR(128) NOT NULL, QUERY_PARALLELISM INTEGER, STATUS VARCHAR(20) NOT NULL, DEFAULT_POOL_ID BIGINT); +CREATE TABLE "APP"."WM_RESOURCEPLAN" (RP_ID BIGINT NOT NULL, NS VARCHAR(128), NAME VARCHAR(128) NOT NULL, QUERY_PARALLELISM INTEGER, STATUS VARCHAR(20) NOT NULL, DEFAULT_POOL_ID BIGINT); CREATE TABLE "APP"."WM_POOL" (POOL_ID BIGINT NOT NULL, RP_ID BIGINT NOT NULL, PATH VARCHAR(1024) NOT NULL, ALLOC_FRACTION DOUBLE, QUERY_PARALLELISM INTEGER, SCHEDULING_POLICY VARCHAR(1024)); @@ -264,7 +264,7 @@ CREATE INDEX "APP"."CONSTRAINTS_PARENT_TBL_ID_INDEX" ON "APP"."KEY_CONSTRAINTS"( CREATE INDEX "APP"."CONSTRAINTS_CONSTRAINT_TYPE_INDEX" ON "APP"."KEY_CONSTRAINTS"("CONSTRAINT_TYPE"); -CREATE UNIQUE INDEX "APP"."UNIQUE_WM_RESOURCEPLAN" ON "APP"."WM_RESOURCEPLAN" ("NAME"); +CREATE UNIQUE INDEX "APP"."UNIQUE_WM_RESOURCEPLAN" ON "APP"."WM_RESOURCEPLAN" ("NS", "NAME"); CREATE UNIQUE INDEX "APP"."UNIQUE_WM_POOL" ON "APP"."WM_POOL" ("RP_ID", "PATH"); diff --git standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql index aca5227a5b..bcaebd18ac 100644 --- standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql +++ standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql @@ -3,6 +3,13 @@ ALTER TABLE "APP"."TBLS" ADD WRITE_ID bigint DEFAULT 0; ALTER TABLE "APP"."PARTITIONS" ADD WRITE_ID bigint DEFAULT 0; +-- HIVE-20793 +ALTER TABLE "APP"."WM_RESOURCEPLAN" ADD NS VARCHAR(128); +UPDATE "APP"."WM_RESOURCEPLAN" SET NS = 'default' WHERE NS IS NULL; +DROP INDEX "APP"."UNIQUE_WM_RESOURCEPLAN"; +CREATE UNIQUE INDEX "APP"."UNIQUE_WM_RESOURCEPLAN" ON "APP"."WM_RESOURCEPLAN" ("NS", "NAME"); + + -- This needs to be the last thing done. Insert any changes above this line. UPDATE "APP".VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; diff --git standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql index 91ba134325..5ea1b4450d 100644 --- standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql +++ standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql @@ -642,6 +642,7 @@ CREATE TABLE WM_RESOURCEPLAN ( RP_ID bigint NOT NULL, "NAME" nvarchar(128) NOT NULL, + NS nvarchar(128), QUERY_PARALLELISM int, STATUS nvarchar(20) NOT NULL, DEFAULT_POOL_ID bigint @@ -963,7 +964,7 @@ CREATE INDEX TABLE_PARAMS_N49 ON TABLE_PARAMS (TBL_ID); -- Constraints for resource plan tables. -CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN ("NAME"); +CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN ("NS", "NAME"); CREATE UNIQUE INDEX UNIQUE_WM_POOL ON WM_POOL (RP_ID, PATH); diff --git standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql index f0d861b3a9..edde08db9e 100644 --- standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql +++ standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql @@ -4,6 +4,12 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS MESSAGE; ALTER TABLE TBLS ADD WRITE_ID bigint NOT NULL DEFAULT 0; ALTER TABLE PARTITIONS ADD WRITE_ID bigint NOT NULL DEFAULT 0; +-- HIVE-20793 +ALTER TABLE WM_RESOURCEPLAN ADD NS nvarchar(128); +UPDATE WM_RESOURCEPLAN SET NS = 'default' WHERE NS IS NULL; +DROP INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN; +CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN ("NS", "NAME"); + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS MESSAGE; diff --git standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql index 3af2ebb253..5555a59c7d 100644 --- standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql +++ standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql @@ -917,11 +917,12 @@ CREATE TABLE IF NOT EXISTS `METASTORE_DB_PROPERTIES` ( CREATE TABLE IF NOT EXISTS WM_RESOURCEPLAN ( `RP_ID` bigint(20) NOT NULL, `NAME` varchar(128) NOT NULL, + `NS` varchar(128), `QUERY_PARALLELISM` int(11), `STATUS` varchar(20) NOT NULL, `DEFAULT_POOL_ID` bigint(20), PRIMARY KEY (`RP_ID`), - UNIQUE KEY `UNIQUE_WM_RESOURCEPLAN` (`NAME`) + UNIQUE KEY `UNIQUE_WM_RESOURCEPLAN` (`NAME`, `NS`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS WM_POOL diff --git standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql index ee0f691b52..701acb0098 100644 --- standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql +++ standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql @@ -4,6 +4,13 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS ' '; ALTER TABLE TBLS ADD WRITE_ID bigint DEFAULT 0; ALTER TABLE PARTITIONS ADD WRITE_ID bigint DEFAULT 0; + +-- HIVE-20793 +ALTER TABLE `WM_RESOURCEPLAN` ADD `NS` varchar(128); +UPDATE `WM_RESOURCEPLAN` SET `NS` = 'default' WHERE `NS` IS NULL; +ALTER TABLE `WM_RESOURCEPLAN` DROP KEY `UNIQUE_WM_RESOURCEPLAN`; +ALTER TABLE `WM_RESOURCEPLAN` ADD UNIQUE KEY `UNIQUE_WM_RESOURCEPLAN` (`NAME`, `NS`); + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS ' '; diff --git standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql index 33aa08015a..b1980c5b83 100644 --- standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql +++ standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql @@ -638,6 +638,7 @@ CREATE TABLE WM_RESOURCEPLAN ( RP_ID NUMBER NOT NULL, "NAME" VARCHAR2(128) NOT NULL, + NS VARCHAR2(128), QUERY_PARALLELISM NUMBER(10), STATUS VARCHAR2(20) NOT NULL, DEFAULT_POOL_ID NUMBER @@ -927,7 +928,7 @@ ALTER TABLE METASTORE_DB_PROPERTIES ADD CONSTRAINT PROPERTY_KEY_PK PRIMARY KEY ( -- Constraints for resource plan tables. -CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN ("NAME"); +CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN (NS, "NAME"); CREATE UNIQUE INDEX UNIQUE_WM_POOL ON WM_POOL (RP_ID, PATH); diff --git standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql index bbb4a39ec4..b9f6331325 100644 --- standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql +++ standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql @@ -3,6 +3,12 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS Status from dual; ALTER TABLE TBLS ADD WRITE_ID number DEFAULT 0 NOT NULL; ALTER TABLE PARTITIONS ADD WRITE_ID number DEFAULT 0 NOT NULL; +-- HIVE-20793 +ALTER TABLE WM_RESOURCEPLAN ADD NS VARCHAR2(128); +UPDATE WM_RESOURCEPLAN SET NS = 'default' WHERE NS IS NULL; +DROP INDEX UNIQUE_WM_RESOURCEPLAN; +CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN (NS, "NAME"); + -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS Status from dual; diff --git standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql index ea088d77fd..9040005aa8 100644 --- standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql +++ standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql @@ -670,6 +670,7 @@ CREATE TABLE "METASTORE_DB_PROPERTIES" CREATE TABLE "WM_RESOURCEPLAN" ( "RP_ID" bigint NOT NULL, "NAME" character varying(128) NOT NULL, + "NS" character varying(128), "QUERY_PARALLELISM" integer, "STATUS" character varying(20) NOT NULL, "DEFAULT_POOL_ID" bigint @@ -1060,7 +1061,7 @@ ALTER TABLE ONLY "WM_RESOURCEPLAN" ADD CONSTRAINT "WM_RESOURCEPLAN_pkey" PRIMARY KEY ("RP_ID"); ALTER TABLE ONLY "WM_RESOURCEPLAN" - ADD CONSTRAINT "UNIQUE_WM_RESOURCEPLAN" UNIQUE ("NAME"); + ADD CONSTRAINT "UNIQUE_WM_RESOURCEPLAN" UNIQUE ("NS", "NAME"); ALTER TABLE ONLY "WM_POOL" ADD CONSTRAINT "WM_POOL_pkey" PRIMARY KEY ("POOL_ID"); diff --git standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql index 2a2d70ae80..0c36069d07 100644 --- standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql +++ standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql @@ -4,6 +4,13 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0'; ALTER TABLE "TBLS" ADD "WRITE_ID" bigint DEFAULT 0; ALTER TABLE "PARTITIONS" ADD "WRITE_ID" bigint DEFAULT 0; + +-- HIVE-20793 +ALTER TABLE "WM_RESOURCEPLAN" ADD "NS" character varying(128); +UPDATE "WM_RESOURCEPLAN" SET "NS" = 'default' WHERE "NS" IS NULL; +ALTER TABLE "WM_RESOURCEPLAN" DROP CONSTRAINT "UNIQUE_WM_RESOURCEPLAN"; +ALTER TABLE ONLY "WM_RESOURCEPLAN" ADD CONSTRAINT "UNIQUE_WM_RESOURCEPLAN" UNIQUE ("NS", "NAME"); + -- These lines need to be last. Insert any changes above. UPDATE "VERSION" SET "SCHEMA_VERSION"='4.0.0', "VERSION_COMMENT"='Hive release version 4.0.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0'; diff --git standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java index 966979891b..c13e538bc4 100644 --- standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java +++ standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java @@ -1060,39 +1060,39 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFrom, int } @Override - public WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectException, + public WMFullResourcePlan getResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { - return objectStore.getResourcePlan(name); + return objectStore.getResourcePlan(name, ns); } @Override - public List getAllResourcePlans() throws MetaException { - return objectStore.getAllResourcePlans(); + public List getAllResourcePlans(String ns) throws MetaException { + return objectStore.getAllResourcePlans(ns); } @Override - public WMFullResourcePlan alterResourcePlan(String name, WMNullableResourcePlan resourcePlan, + public WMFullResourcePlan alterResourcePlan(String name, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { return objectStore.alterResourcePlan( - name, resourcePlan, canActivateDisabled, canDeactivate, isReplace); + name, ns, resourcePlan, canActivateDisabled, canDeactivate, isReplace); } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException { - return objectStore.getActiveResourcePlan(); + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException { + return objectStore.getActiveResourcePlan(ns); } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String name) + public WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException { - return objectStore.validateResourcePlan(name); + return objectStore.validateResourcePlan(name, ns); } @Override - public void dropResourcePlan(String name) throws NoSuchObjectException, MetaException { - objectStore.dropResourcePlan(name); + public void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { + objectStore.dropResourcePlan(name, ns); } @Override @@ -1109,15 +1109,15 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMTrigger(resourcePlanName, triggerName); + objectStore.dropWMTrigger(resourcePlanName, triggerName, ns); } @Override - public List getTriggersForResourcePlan(String resourcePlanName) + public List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException { - return objectStore.getTriggersForResourcePlan(resourcePlanName); + return objectStore.getTriggersForResourcePlan(resourcePlanName, ns); } @Override @@ -1133,9 +1133,9 @@ public void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExists } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMPool(resourcePlanName, poolPath); + objectStore.dropWMPool(resourcePlanName, poolPath, ns); } @Override @@ -1153,15 +1153,15 @@ public void dropWMMapping(WMMapping mapping) @Override public void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + objectStore.createWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } @Override public void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws NoSuchObjectException, InvalidOperationException, MetaException { - objectStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath); + String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { + objectStore.dropWMTriggerToPoolMapping(resourcePlanName, triggerName, poolPath, ns); } diff --git standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java index 593d562c34..e943f17a36 100644 --- standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java +++ standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java @@ -1051,36 +1051,36 @@ public void createResourcePlan( } @Override - public WMFullResourcePlan getResourcePlan(String name) throws NoSuchObjectException { + public WMFullResourcePlan getResourcePlan(String name, String ns) throws NoSuchObjectException { return null; } @Override - public List getAllResourcePlans() throws MetaException { + public List getAllResourcePlans(String ns) throws MetaException { return null; } @Override public WMFullResourcePlan alterResourcePlan( - String name, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, + String name, String ns, WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean canDeactivate, boolean isReplace) throws NoSuchObjectException, InvalidOperationException, MetaException { return null; } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException { + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException { return null; } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String name) + public WMValidateResourcePlanResponse validateResourcePlan(String name, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException { return null; } @Override - public void dropResourcePlan(String name) throws NoSuchObjectException, MetaException { + public void dropResourcePlan(String name, String ns) throws NoSuchObjectException, MetaException { } @Override @@ -1093,12 +1093,12 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, MetaException { } @Override - public List getTriggersForResourcePlan(String resourcePlanName) + public List getTriggersForResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException { return null; } @@ -1114,7 +1114,7 @@ public void alterPool(WMNullablePool pool, String poolPath) throws AlreadyExists } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { } @@ -1131,13 +1131,13 @@ public void dropWMMapping(WMMapping mapping) @Override public void createWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidOperationException, MetaException { } @Override public void dropWMTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath) throws NoSuchObjectException, InvalidOperationException, MetaException { + String poolPath, String ns) throws NoSuchObjectException, InvalidOperationException, MetaException { } @Override diff --git standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java index 4293579ad8..9fe9a65677 100644 --- standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java +++ standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java @@ -51,6 +51,7 @@ import javax.security.auth.login.LoginException; import com.google.common.base.Preconditions; + import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; @@ -2833,34 +2834,39 @@ public void createResourcePlan(WMResourcePlan resourcePlan, String copyFromName) } @Override - public WMFullResourcePlan getResourcePlan(String resourcePlanName) + public WMFullResourcePlan getResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException { WMGetResourcePlanRequest request = new WMGetResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); return client.get_resource_plan(request).getResourcePlan(); } @Override - public List getAllResourcePlans() + public List getAllResourcePlans(String ns) throws NoSuchObjectException, MetaException, TException { WMGetAllResourcePlanRequest request = new WMGetAllResourcePlanRequest(); + request.setNs(ns); return client.get_all_resource_plans(request).getResourcePlans(); } @Override - public void dropResourcePlan(String resourcePlanName) + public void dropResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, MetaException, TException { WMDropResourcePlanRequest request = new WMDropResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); client.drop_resource_plan(request); } @Override - public WMFullResourcePlan alterResourcePlan(String resourcePlanName, WMNullableResourcePlan resourcePlan, + public WMFullResourcePlan alterResourcePlan(String resourcePlanName, String ns, + WMNullableResourcePlan resourcePlan, boolean canActivateDisabled, boolean isForceDeactivate, boolean isReplace) throws NoSuchObjectException, InvalidObjectException, MetaException, TException { WMAlterResourcePlanRequest request = new WMAlterResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); request.setResourcePlan(resourcePlan); request.setIsEnableAndActivate(canActivateDisabled); request.setIsForceDeactivate(isForceDeactivate); @@ -2870,15 +2876,18 @@ public WMFullResourcePlan alterResourcePlan(String resourcePlanName, WMNullableR } @Override - public WMFullResourcePlan getActiveResourcePlan() throws MetaException, TException { - return client.get_active_resource_plan(new WMGetActiveResourcePlanRequest()).getResourcePlan(); + public WMFullResourcePlan getActiveResourcePlan(String ns) throws MetaException, TException { + WMGetActiveResourcePlanRequest request = new WMGetActiveResourcePlanRequest(); + request.setNs(ns); + return client.get_active_resource_plan(request).getResourcePlan(); } @Override - public WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName) + public WMValidateResourcePlanResponse validateResourcePlan(String resourcePlanName, String ns) throws NoSuchObjectException, InvalidObjectException, MetaException, TException { WMValidateResourcePlanRequest request = new WMValidateResourcePlanRequest(); request.setResourcePlanName(resourcePlanName); + request.setNs(ns); return client.validate_resource_plan(request); } @@ -2899,19 +2908,21 @@ public void alterWMTrigger(WMTrigger trigger) } @Override - public void dropWMTrigger(String resourcePlanName, String triggerName) + public void dropWMTrigger(String resourcePlanName, String triggerName, String ns) throws NoSuchObjectException, MetaException, TException { WMDropTriggerRequest request = new WMDropTriggerRequest(); request.setResourcePlanName(resourcePlanName); request.setTriggerName(triggerName); + request.setNs(ns); client.drop_wm_trigger(request); } @Override - public List getTriggersForResourcePlan(String resourcePlan) + public List getTriggersForResourcePlan(String resourcePlan, String ns) throws NoSuchObjectException, MetaException, TException { WMGetTriggersForResourePlanRequest request = new WMGetTriggersForResourePlanRequest(); request.setResourcePlanName(resourcePlan); + request.setNs(ns); return client.get_triggers_for_resourceplan(request).getTriggers(); } @@ -2933,11 +2944,12 @@ public void alterWMPool(WMNullablePool pool, String poolPath) } @Override - public void dropWMPool(String resourcePlanName, String poolPath) + public void dropWMPool(String resourcePlanName, String poolPath, String ns) throws NoSuchObjectException, MetaException, TException { WMDropPoolRequest request = new WMDropPoolRequest(); request.setResourcePlanName(resourcePlanName); request.setPoolPath(poolPath); + request.setNs(ns); client.drop_wm_pool(request); } @@ -2960,16 +2972,18 @@ public void dropWMMapping(WMMapping mapping) @Override public void createOrDropTriggerToPoolMapping(String resourcePlanName, String triggerName, - String poolPath, boolean shouldDrop) throws AlreadyExistsException, NoSuchObjectException, + String poolPath, boolean shouldDrop, String ns) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException { WMCreateOrDropTriggerToPoolMappingRequest request = new WMCreateOrDropTriggerToPoolMappingRequest(); request.setResourcePlanName(resourcePlanName); request.setTriggerName(triggerName); request.setPoolPath(poolPath); request.setDrop(shouldDrop); + request.setNs(ns); client.create_or_drop_wm_trigger_to_pool_mapping(request); } + @Override public void createCatalog(Catalog catalog) throws AlreadyExistsException, InvalidObjectException, MetaException, TException {