Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartitionRemote.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartitionRemote.java (revision 0) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartitionRemote.java (revision 0) @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore; + +import org.apache.hadoop.hive.conf.HiveConf; + +public class TestMarkPartitionRemote extends TestMarkPartition{ + + private static class RunMS implements Runnable { + + @Override + public void run() { + try { + HiveMetaStore.main(new String[] { "29111" }); + } catch (Throwable e) { + e.printStackTrace(System.err); + assert false; + } + } + + } + @Override + protected void setUp() throws Exception { + super.setUp(); + Thread t = new Thread(new RunMS()); + t.setDaemon(true); + t.start(); + hiveConf.set("hive.metastore.local", "false"); + hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:29111"); + hiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTRETRIES, 3); + Thread.sleep(30000); + } +} Index: metastore/src/test/org/apache/hadoop/hive/metastore/DummyListener.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/DummyListener.java (revision 1136105) +++ metastore/src/test/org/apache/hadoop/hive/metastore/DummyListener.java (working copy) @@ -30,6 +30,7 @@ import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; import org.apache.hadoop.hive.metastore.events.ListenerEvent; +import org.apache.hadoop.hive.metastore.events.LoadPartitionDoneEvent; /** A dummy implementation for * {@link org.apache.hadoop.hive.metastore.hadooorg.apache.hadoop.hive.metastore.MetaStoreEventListener} @@ -72,4 +73,9 @@ public void onDropTable(DropTableEvent table) throws MetaException { notifyList.add(table); } + + @Override + public void onLoadPartitionDone(LoadPartitionDoneEvent partEvent) throws MetaException { + notifyList.add(partEvent); + } } Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartition.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartition.java (revision 0) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestMarkPartition.java (revision 0) @@ -0,0 +1,102 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore; + +import java.util.HashMap; +import java.util.Map; + +import junit.framework.TestCase; + +import org.apache.hadoop.hive.cli.CliSessionState; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; +import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; +import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; +import org.apache.hadoop.hive.metastore.api.UnknownTableException; +import org.apache.hadoop.hive.ql.CommandNeedRetryException; +import org.apache.hadoop.hive.ql.Driver; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.thrift.TException; + +public class TestMarkPartition extends TestCase{ + + protected HiveConf hiveConf; + private Driver driver; + + @Override + protected void setUp() throws Exception { + + super.setUp(); + hiveConf = new HiveConf(this.getClass()); + hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); + hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); + hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false"); + SessionState.start(new CliSessionState(hiveConf)); + + } + + public void testMarkingPartitionSet() throws CommandNeedRetryException, MetaException, + TException, NoSuchObjectException, UnknownDBException, UnknownTableException, + InvalidPartitionException, UnknownPartitionException { + HiveMetaStoreClient msc = new HiveMetaStoreClient(hiveConf, null); + driver = new Driver(hiveConf); + driver.run("drop database if exists tmpdb cascade"); + driver.run("create database tmpdb"); + driver.run("use tmpdb"); + driver.run("drop table if exists tmptbl"); + driver.run("create table tmptbl (a string) partitioned by (b string)"); + driver.run("alter table tmptbl add partition (b='2011')"); + Map kvs = new HashMap(); + kvs.put("b", "'2011'"); + msc.markPartitionForEvent("tmpdb", "tmptbl", kvs, PartitionEventType.LOAD_DONE); + assert msc.isPartitionMarkedForEvent("tmpdb", "tmptbl", kvs, PartitionEventType.LOAD_DONE); + + kvs.put("b", "'2012'"); + assert !msc.isPartitionMarkedForEvent("tmpdb", "tmptbl", kvs, PartitionEventType.LOAD_DONE); + try{ + msc.markPartitionForEvent("tmpdb", "tmptbl2", kvs, PartitionEventType.LOAD_DONE); + assert false; + } catch(Exception e){ + assert e instanceof UnknownTableException; + } + try{ + msc.isPartitionMarkedForEvent("tmpdb", "tmptbl2", kvs, PartitionEventType.LOAD_DONE); + assert false; + } catch(Exception e){ + assert e instanceof UnknownTableException; + } + kvs.put("a", "'2012'"); + try{ + msc.isPartitionMarkedForEvent("tmpdb", "tmptbl", kvs, PartitionEventType.LOAD_DONE); + assert false; + } catch(Exception e){ + assert e instanceof InvalidPartitionException; + } + } + + @Override + protected void tearDown() throws Exception { + driver.run("drop database if exists tmpdb cascade"); + super.tearDown(); + } + +} Index: metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java =================================================================== --- metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java (revision 1136105) +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java (working copy) @@ -18,7 +18,9 @@ package org.apache.hadoop.hive.metastore; +import java.util.HashMap; import java.util.List; +import java.util.Map; import junit.framework.TestCase; @@ -27,6 +29,7 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.events.AddPartitionEvent; import org.apache.hadoop.hive.metastore.events.CreateDatabaseEvent; @@ -35,6 +38,7 @@ import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; import org.apache.hadoop.hive.metastore.events.ListenerEvent; +import org.apache.hadoop.hive.metastore.events.LoadPartitionDoneEvent; import org.apache.hadoop.hive.ql.Driver; import org.apache.hadoop.hive.ql.session.SessionState; @@ -60,7 +64,6 @@ assert false; } } - } @Override @@ -119,17 +122,26 @@ assert partEvent.getStatus(); assertEquals(part, partEvent.getPartition()); + Map kvs = new HashMap(1); + kvs.put("b", "2011"); + msc.markPartitionForEvent("tmpdb", "tmptbl", kvs, PartitionEventType.LOAD_DONE); + assertEquals(notifyList.size(), 4); + LoadPartitionDoneEvent partMarkEvent = (LoadPartitionDoneEvent)notifyList.get(3); + assert partMarkEvent.getStatus(); + assertEquals(partMarkEvent.getPartitionName(), kvs); + assertEquals(partMarkEvent.getTable().getTableName(), "tmptbl"); + driver.run("alter table tmptbl drop partition (b='2011')"); - assertEquals(notifyList.size(), 4); - DropPartitionEvent dropPart = (DropPartitionEvent)notifyList.get(3); + assertEquals(notifyList.size(), 5); + DropPartitionEvent dropPart = (DropPartitionEvent)notifyList.get(4); assert dropPart.getStatus(); assertEquals(part.getValues(), dropPart.getPartition().getValues()); assertEquals(part.getDbName(), dropPart.getPartition().getDbName()); assertEquals(part.getTableName(), dropPart.getPartition().getTableName()); driver.run("drop table tmptbl"); - assertEquals(notifyList.size(), 5); - DropTableEvent dropTbl = (DropTableEvent)notifyList.get(4); + assertEquals(notifyList.size(), 6); + DropTableEvent dropTbl = (DropTableEvent)notifyList.get(5); assert dropTbl.getStatus(); assertEquals(tbl.getTableName(), dropTbl.getTable().getTableName()); assertEquals(tbl.getDbName(), dropTbl.getTable().getDbName()); @@ -137,8 +149,8 @@ driver.run("drop database tmpdb"); - assertEquals(notifyList.size(), 6); - DropDatabaseEvent dropDB = (DropDatabaseEvent)notifyList.get(5); + assertEquals(notifyList.size(), 7); + DropDatabaseEvent dropDB = (DropDatabaseEvent)notifyList.get(6); assert dropDB.getStatus(); assertEquals(db, dropDB.getDatabase()); } Index: metastore/src/model/package.jdo =================================================================== --- metastore/src/model/package.jdo (revision 1136105) +++ metastore/src/model/package.jdo (working copy) @@ -665,5 +665,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MPartitionEvent.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MPartitionEvent.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MPartitionEvent.java (revision 0) @@ -0,0 +1,90 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + + +public class MPartitionEvent { + + private String dbName; + + private String tblName; + + private String partName; + + private long eventTime; + + private int eventType; + + public MPartitionEvent(String dbName, String tblName, String partitionName, int eventType) { + super(); + this.dbName = dbName; + this.tblName = tblName; + this.partName = partitionName; + this.eventType = eventType; + this.eventTime = System.currentTimeMillis(); + } + + public MPartitionEvent() {} + + /** + * @param dbName the dbName to set + */ + public void setDbName(String dbName) { + this.dbName = dbName; + } + + /** + * @param tblName the tblName to set + */ + public void setTblName(String tblName) { + this.tblName = tblName; + } + + /** + * @param partName the partSpec to set + */ + public void setPartName(String partName) { + this.partName = partName; + } + + /** + * @param eventTime the eventTime to set + */ + public void setEventTime(long createTime) { + this.eventTime = createTime; + } + + /** + * @param eventType the EventType to set + */ + public void setEventType(int eventType) { + this.eventType = eventType; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "MPartitionEvent [dbName=" + dbName + ", tblName=" + tblName + ", partName=" + partName + + ", eventTime=" + eventTime + ", EventType=" + eventType + "]"; + } + + +} Index: metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (working copy) @@ -19,14 +19,17 @@ package org.apache.hadoop.hive.metastore; import java.util.List; +import java.util.Map; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.Index; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; @@ -34,6 +37,8 @@ import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.Type; import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; +import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.hadoop.hive.metastore.model.MDBPrivilege; import org.apache.hadoop.hive.metastore.model.MGlobalPrivilege; import org.apache.hadoop.hive.metastore.model.MPartitionColumnPrivilege; @@ -163,6 +168,10 @@ String dbName, String tblName, List partNames) throws MetaException, NoSuchObjectException; + public abstract Table markPartitionForEvent(String dbName, String tblName, Map partVals, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException; + + public abstract boolean isPartitionMarkedForEvent(String dbName, String tblName, Map partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException; + public abstract boolean addRole(String rowName, String ownerName) throws InvalidObjectException, MetaException, NoSuchObjectException; Index: metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java (working copy) @@ -27,6 +27,7 @@ import org.apache.hadoop.hive.metastore.events.DropDatabaseEvent; import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; +import org.apache.hadoop.hive.metastore.events.LoadPartitionDoneEvent; /** * This abstract class needs to be extended to provide implementation of actions that needs @@ -78,6 +79,12 @@ */ public abstract void onDropDatabase (DropDatabaseEvent dbEvent) throws MetaException; + /** + * @param partSetDoneEvent + * @throws MetaException + */ + public abstract void onLoadPartitionDone(LoadPartitionDoneEvent partSetDoneEvent) throws MetaException; + @Override public Configuration getConf() { return this.conf; Index: metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (working copy) @@ -30,15 +30,18 @@ import org.apache.hadoop.hive.metastore.api.Index; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; import org.apache.hadoop.hive.metastore.api.Role; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.thrift.TException; @@ -388,6 +391,40 @@ List groupNames) throws MetaException, TException, NoSuchObjectException; /** + * @param db_name + * @param tbl_name + * @param partKVs + * @param eventType + * @throws MetaException + * @throws NoSuchObjectException + * @throws TException + * @throws UnknownTableException + * @throws UnknownDBException + * @throws UnknownPartitionException + * @throws InvalidPartitionException + */ + public void markPartitionForEvent(String db_name, String tbl_name, Map partKVs, + PartitionEventType eventType) throws MetaException, NoSuchObjectException, TException, + UnknownTableException, UnknownDBException, UnknownPartitionException, InvalidPartitionException; + + /** + * @param db_name + * @param tbl_name + * @param partKVs + * @param eventType + * @throws MetaException + * @throws NoSuchObjectException + * @throws TException + * @throws UnknownTableException + * @throws UnknownDBException + * @throws UnknownPartitionException + * @throws InvalidPartitionException + */ + public boolean isPartitionMarkedForEvent(String db_name, String tbl_name, Map partKVs, + PartitionEventType eventType) throws MetaException, NoSuchObjectException, TException, + UnknownTableException, UnknownDBException, UnknownPartitionException, InvalidPartitionException; + + /** * @param tbl * @throws AlreadyExistsException * @throws InvalidObjectException @@ -396,6 +433,7 @@ * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#create_table(org.apache.hadoop.hive.metastore.api.Table) */ + public void createTable(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException; Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (working copy) @@ -45,9 +45,11 @@ import org.apache.hadoop.hive.metastore.api.Index; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; @@ -56,6 +58,7 @@ import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore; import org.apache.hadoop.hive.metastore.api.Type; import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge; @@ -1137,4 +1140,24 @@ } } + @Override + public void markPartitionForEvent(String db_name, String tbl_name, Map partKVs, PartitionEventType eventType) + throws MetaException, TException, NoSuchObjectException, UnknownDBException, UnknownTableException, + InvalidPartitionException, UnknownPartitionException { + assert db_name != null; + assert tbl_name != null; + assert partKVs != null; + client.markPartitionForEvent(db_name, tbl_name, partKVs, eventType); + } + + @Override + public boolean isPartitionMarkedForEvent(String db_name, String tbl_name, Map partKVs, PartitionEventType eventType) + throws MetaException, NoSuchObjectException, UnknownTableException, UnknownDBException, TException, + InvalidPartitionException, UnknownPartitionException { + assert db_name != null; + assert tbl_name != null; + assert partKVs != null; + return client.isPartitionMarkedForEvent(db_name, tbl_name, partKVs, eventType); + } + } Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (working copy) @@ -54,9 +54,11 @@ import org.apache.hadoop.hive.metastore.api.IndexAlreadyExistsException; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; @@ -66,6 +68,7 @@ import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore; import org.apache.hadoop.hive.metastore.api.Type; import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.hadoop.hive.metastore.events.AddPartitionEvent; import org.apache.hadoop.hive.metastore.events.CreateDatabaseEvent; @@ -73,6 +76,7 @@ import org.apache.hadoop.hive.metastore.events.DropDatabaseEvent; import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; +import org.apache.hadoop.hive.metastore.events.LoadPartitionDoneEvent; import org.apache.hadoop.hive.metastore.hooks.JDOConnectionURLHook; import org.apache.hadoop.hive.metastore.model.MDBPrivilege; import org.apache.hadoop.hive.metastore.model.MGlobalPrivilege; @@ -527,6 +531,11 @@ + "[" + join(partVals, ",") + "]" ); } + public String startPartitionFunction(String function, String db, String tbl, + Map partName) { + return startFunction(function, " : db=" + db + " tbl=" + tbl + "partition=" + partName); + } + public void endFunction(String function) { try { Metrics.endScope(function); @@ -3173,8 +3182,97 @@ } } + @Override + public void markPartitionForEvent(final String db_name, final String tbl_name, + final Map partName, final PartitionEventType evtType) throws + MetaException,TException, NoSuchObjectException, UnknownDBException, UnknownTableException, + InvalidPartitionException, UnknownPartitionException { + + try { + startPartitionFunction("markPartitionForEvent", db_name, tbl_name, partName); + Table tbl = null; + try{ + tbl = executeWithRetry(new Command(){ + @Override + public Table run(RawStore ms) throws Exception { + return ms.markPartitionForEvent(db_name, tbl_name, partName, evtType); + } + }); + } catch (Exception original) { + LOG.error(original); + if (original instanceof NoSuchObjectException) { + throw (NoSuchObjectException)original; + } else if(original instanceof UnknownTableException){ + throw (UnknownTableException)original; + } else if(original instanceof UnknownDBException){ + throw (UnknownDBException)original; + } else if(original instanceof UnknownPartitionException){ + throw (UnknownPartitionException)original; + } else if(original instanceof InvalidPartitionException){ + throw (InvalidPartitionException)original; + } else if(original instanceof MetaException){ + throw (MetaException)original; + } else{ + MetaException me = new MetaException(original.toString()); + me.initCause(original); + throw me; + } + } + if (null == tbl) { + throw new UnknownTableException("Table: "+tbl_name + " not found."); + } else{ + for(MetaStoreEventListener listener : listeners){ + listener.onLoadPartitionDone(new LoadPartitionDoneEvent(true, this, tbl, partName)); + } + } + } + finally{ + endFunction("markPartitionForEvent"); + } + } + + @Override + public boolean isPartitionMarkedForEvent(final String db_name, final String tbl_name, + final Map partName, final PartitionEventType evtType) throws + MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, + TException, UnknownPartitionException, InvalidPartitionException { + + startPartitionFunction("isPartitionMarkedForEvent", db_name, tbl_name, partName); + try { + return executeWithRetry(new Command(){ + @Override + public Boolean run(RawStore ms) throws Exception { + return ms.isPartitionMarkedForEvent(db_name, tbl_name, partName, evtType); + } + + }); + } catch (Exception original) { + LOG.error(original); + if (original instanceof NoSuchObjectException) { + throw (NoSuchObjectException)original; + } else if(original instanceof UnknownTableException){ + throw (UnknownTableException)original; + } else if(original instanceof UnknownDBException){ + throw (UnknownDBException)original; + } else if(original instanceof UnknownPartitionException){ + throw (UnknownPartitionException)original; + } else if(original instanceof InvalidPartitionException){ + throw (InvalidPartitionException)original; + } else if(original instanceof MetaException){ + throw (MetaException)original; + } else{ + MetaException me = new MetaException(original.toString()); + me.initCause(original); + throw me; + } + } + finally{ + endFunction("isPartitionMarkedForEvent"); + } + } } + /** * Discard a current delegation token. * @param tokenStrForm the token in string form Index: metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (revision 1136105) +++ metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (working copy) @@ -18,6 +18,8 @@ package org.apache.hadoop.hive.metastore; +import static org.apache.commons.lang.StringUtils.join; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -58,10 +60,12 @@ import org.apache.hadoop.hive.metastore.api.HiveObjectType; import org.apache.hadoop.hive.metastore.api.Index; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; +import org.apache.hadoop.hive.metastore.api.InvalidPartitionException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PartitionEventType; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; @@ -72,6 +76,8 @@ import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.Type; import org.apache.hadoop.hive.metastore.api.UnknownDBException; +import org.apache.hadoop.hive.metastore.api.UnknownPartitionException; +import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.hadoop.hive.metastore.model.MDBPrivilege; import org.apache.hadoop.hive.metastore.model.MDatabase; import org.apache.hadoop.hive.metastore.model.MFieldSchema; @@ -80,6 +86,7 @@ import org.apache.hadoop.hive.metastore.model.MOrder; import org.apache.hadoop.hive.metastore.model.MPartition; import org.apache.hadoop.hive.metastore.model.MPartitionColumnPrivilege; +import org.apache.hadoop.hive.metastore.model.MPartitionEvent; import org.apache.hadoop.hive.metastore.model.MPartitionPrivilege; import org.apache.hadoop.hive.metastore.model.MRole; import org.apache.hadoop.hive.metastore.model.MRoleMap; @@ -3398,4 +3405,72 @@ return mSecurityColumnList; } + @Override + public boolean isPartitionMarkedForEvent(String dbName, String tblName, + Map partName, PartitionEventType evtType) throws UnknownTableException, + MetaException, InvalidPartitionException, UnknownPartitionException { + + Collection partEvents; + boolean success = false; + LOG.debug("Begin Executing isPartitionMarkedForEvent"); + try{ + openTransaction(); + Query query = pm.newQuery(MPartitionEvent.class, "dbName == t1 && tblName == t2 && partName == t3 && eventType == t4"); + query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3, int t4"); + Table tbl = getTable(dbName, tblName); // Make sure dbName and tblName are valid. + if(null == tbl) { + throw new UnknownTableException("Table: "+ tblName + " is not found."); + } + partEvents = (Collection) query.executeWithArray(dbName, tblName, getPartitionStr(tbl, partName), evtType.getValue()); + pm.retrieveAll(partEvents); + success = commitTransaction(); + LOG.debug("Done executing isPartitionMarkedForEvent"); + } finally{ + if (!success) { + rollbackTransaction(); + } + } + return (partEvents != null && !partEvents.isEmpty()) ? true : false; + + } + + @Override + public Table markPartitionForEvent(String dbName, String tblName, Map partName, + PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { + + LOG.debug("Begin executing markPartitionForEvent"); + boolean success = false; + Table tbl = null; + try{ + openTransaction(); + tbl = getTable(dbName, tblName); // Make sure dbName and tblName are valid. + if(null == tbl) { + throw new UnknownTableException("Table: "+ tblName + " is not found."); + } + pm.makePersistent(new MPartitionEvent(dbName,tblName,getPartitionStr(tbl, partName), evtType.getValue())); + success = commitTransaction(); + LOG.debug("Done executing markPartitionForEvent"); + } finally { + if(!success) { + rollbackTransaction(); + } + } + return tbl; + } + + private String getPartitionStr(Table tbl, Map partName) throws InvalidPartitionException{ + if(tbl.getPartitionKeysSize() != partName.size()){ + throw new InvalidPartitionException("Number of partition columns in table: "+ tbl.getPartitionKeysSize() + + " doesn't match with number of supplied partition values: "+partName.size()); + } + final List storedVals = new ArrayList(tbl.getPartitionKeysSize()); + for(FieldSchema partKey : tbl.getPartitionKeys()){ + String partVal = partName.get(partKey.getName()); + if(null == partVal) { + throw new InvalidPartitionException("No value found for partition column: "+partKey.getName()); + } + storedVals.add(partVal); + } + return join(storedVals,','); + } } Index: metastore/src/java/org/apache/hadoop/hive/metastore/events/LoadPartitionDoneEvent.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/events/LoadPartitionDoneEvent.java (revision 0) +++ metastore/src/java/org/apache/hadoop/hive/metastore/events/LoadPartitionDoneEvent.java (revision 0) @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.events; + +import java.util.Map; + +import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler; +import org.apache.hadoop.hive.metastore.api.Table; + +public class LoadPartitionDoneEvent extends ListenerEvent { + + private final Table table; + + private final Map partSpec; + + public LoadPartitionDoneEvent(boolean status, HMSHandler handler, Table table, + Map partSpec) { + super(status, handler); + this.table = table; + this.partSpec = partSpec; + } + + /** + * @return the tblName + */ + public Table getTable() { + return table; + } + + /** + * @return the partition Name + */ + public Map getPartitionName() { + return partSpec; + } + +} Index: metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py (revision 1136105) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py (working copy) @@ -56,7 +56,18 @@ "GROUP": 3, } +class PartitionEventType: + LOAD_DONE = 1 + _VALUES_TO_NAMES = { + 1: "LOAD_DONE", + } + + _NAMES_TO_VALUES = { + "LOAD_DONE": 1, + } + + class Version: """ Attributes: @@ -2314,6 +2325,130 @@ def __ne__(self, other): return not (self == other) +class InvalidPartitionException(Exception): + """ + Attributes: + - message + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + ) + + def __init__(self, message=None,): + self.message = message + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('InvalidPartitionException') + if self.message != None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class UnknownPartitionException(Exception): + """ + Attributes: + - message + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + ) + + def __init__(self, message=None,): + self.message = message + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('UnknownPartitionException') + if self.message != None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class InvalidObjectException(Exception): """ Attributes: Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (revision 1136105) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py (working copy) @@ -346,6 +346,26 @@ """ pass + def markPartitionForEvent(self, db_name, tbl_name, part_vals, eventType): + """ + Parameters: + - db_name + - tbl_name + - part_vals + - eventType + """ + pass + + def isPartitionMarkedForEvent(self, db_name, tbl_name, part_vals, eventType): + """ + Parameters: + - db_name + - tbl_name + - part_vals + - eventType + """ + pass + def add_index(self, new_index, index_table): """ Parameters: @@ -1930,6 +1950,100 @@ raise result.o1 raise TApplicationException(TApplicationException.MISSING_RESULT, "partition_name_to_spec failed: unknown result"); + def markPartitionForEvent(self, db_name, tbl_name, part_vals, eventType): + """ + Parameters: + - db_name + - tbl_name + - part_vals + - eventType + """ + self.send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType) + self.recv_markPartitionForEvent() + + def send_markPartitionForEvent(self, db_name, tbl_name, part_vals, eventType): + self._oprot.writeMessageBegin('markPartitionForEvent', TMessageType.CALL, self._seqid) + args = markPartitionForEvent_args() + args.db_name = db_name + args.tbl_name = tbl_name + args.part_vals = part_vals + args.eventType = eventType + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_markPartitionForEvent(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = markPartitionForEvent_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.o1 != None: + raise result.o1 + if result.o2 != None: + raise result.o2 + if result.o3 != None: + raise result.o3 + if result.o4 != None: + raise result.o4 + if result.o5 != None: + raise result.o5 + if result.o6 != None: + raise result.o6 + return + + def isPartitionMarkedForEvent(self, db_name, tbl_name, part_vals, eventType): + """ + Parameters: + - db_name + - tbl_name + - part_vals + - eventType + """ + self.send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType) + return self.recv_isPartitionMarkedForEvent() + + def send_isPartitionMarkedForEvent(self, db_name, tbl_name, part_vals, eventType): + self._oprot.writeMessageBegin('isPartitionMarkedForEvent', TMessageType.CALL, self._seqid) + args = isPartitionMarkedForEvent_args() + args.db_name = db_name + args.tbl_name = tbl_name + args.part_vals = part_vals + args.eventType = eventType + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_isPartitionMarkedForEvent(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = isPartitionMarkedForEvent_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + if result.o2 != None: + raise result.o2 + if result.o3 != None: + raise result.o3 + if result.o4 != None: + raise result.o4 + if result.o5 != None: + raise result.o5 + if result.o6 != None: + raise result.o6 + raise TApplicationException(TApplicationException.MISSING_RESULT, "isPartitionMarkedForEvent failed: unknown result"); + def add_index(self, new_index, index_table): """ Parameters: @@ -2636,6 +2750,8 @@ self._processMap["get_config_value"] = Processor.process_get_config_value self._processMap["partition_name_to_vals"] = Processor.process_partition_name_to_vals self._processMap["partition_name_to_spec"] = Processor.process_partition_name_to_spec + self._processMap["markPartitionForEvent"] = Processor.process_markPartitionForEvent + self._processMap["isPartitionMarkedForEvent"] = Processor.process_isPartitionMarkedForEvent self._processMap["add_index"] = Processor.process_add_index self._processMap["alter_index"] = Processor.process_alter_index self._processMap["drop_index_by_name"] = Processor.process_drop_index_by_name @@ -3295,6 +3411,54 @@ oprot.writeMessageEnd() oprot.trans.flush() + def process_markPartitionForEvent(self, seqid, iprot, oprot): + args = markPartitionForEvent_args() + args.read(iprot) + iprot.readMessageEnd() + result = markPartitionForEvent_result() + try: + self._handler.markPartitionForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType) + except MetaException, o1: + result.o1 = o1 + except NoSuchObjectException, o2: + result.o2 = o2 + except UnknownDBException, o3: + result.o3 = o3 + except UnknownTableException, o4: + result.o4 = o4 + except UnknownPartitionException, o5: + result.o5 = o5 + except InvalidPartitionException, o6: + result.o6 = o6 + oprot.writeMessageBegin("markPartitionForEvent", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_isPartitionMarkedForEvent(self, seqid, iprot, oprot): + args = isPartitionMarkedForEvent_args() + args.read(iprot) + iprot.readMessageEnd() + result = isPartitionMarkedForEvent_result() + try: + result.success = self._handler.isPartitionMarkedForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType) + except MetaException, o1: + result.o1 = o1 + except NoSuchObjectException, o2: + result.o2 = o2 + except UnknownDBException, o3: + result.o3 = o3 + except UnknownTableException, o4: + result.o4 = o4 + except UnknownPartitionException, o5: + result.o5 = o5 + except InvalidPartitionException, o6: + result.o6 = o6 + oprot.writeMessageBegin("isPartitionMarkedForEvent", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_add_index(self, seqid, iprot, oprot): args = add_index_args() args.read(iprot) @@ -10012,6 +10176,477 @@ def __ne__(self, other): return not (self == other) +class markPartitionForEvent_args: + """ + Attributes: + - db_name + - tbl_name + - part_vals + - eventType + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'db_name', None, None, ), # 1 + (2, TType.STRING, 'tbl_name', None, None, ), # 2 + (3, TType.MAP, 'part_vals', (TType.STRING,None,TType.STRING,None), None, ), # 3 + (4, TType.I32, 'eventType', None, None, ), # 4 + ) + + def __init__(self, db_name=None, tbl_name=None, part_vals=None, eventType=None,): + self.db_name = db_name + self.tbl_name = tbl_name + self.part_vals = part_vals + self.eventType = eventType + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.db_name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tbl_name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.MAP: + self.part_vals = {} + (_ktype389, _vtype390, _size388 ) = iprot.readMapBegin() + for _i392 in xrange(_size388): + _key393 = iprot.readString(); + _val394 = iprot.readString(); + self.part_vals[_key393] = _val394 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.eventType = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('markPartitionForEvent_args') + if self.db_name != None: + oprot.writeFieldBegin('db_name', TType.STRING, 1) + oprot.writeString(self.db_name) + oprot.writeFieldEnd() + if self.tbl_name != None: + oprot.writeFieldBegin('tbl_name', TType.STRING, 2) + oprot.writeString(self.tbl_name) + oprot.writeFieldEnd() + if self.part_vals != None: + oprot.writeFieldBegin('part_vals', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) + for kiter395,viter396 in self.part_vals.items(): + oprot.writeString(kiter395) + oprot.writeString(viter396) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.eventType != None: + oprot.writeFieldBegin('eventType', TType.I32, 4) + oprot.writeI32(self.eventType) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class markPartitionForEvent_result: + """ + Attributes: + - o1 + - o2 + - o3 + - o4 + - o5 + - o6 + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (UnknownDBException, UnknownDBException.thrift_spec), None, ), # 3 + (4, TType.STRUCT, 'o4', (UnknownTableException, UnknownTableException.thrift_spec), None, ), # 4 + (5, TType.STRUCT, 'o5', (UnknownPartitionException, UnknownPartitionException.thrift_spec), None, ), # 5 + (6, TType.STRUCT, 'o6', (InvalidPartitionException, InvalidPartitionException.thrift_spec), None, ), # 6 + ) + + def __init__(self, o1=None, o2=None, o3=None, o4=None, o5=None, o6=None,): + self.o1 = o1 + self.o2 = o2 + self.o3 = o3 + self.o4 = o4 + self.o5 = o5 + self.o6 = o6 + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = NoSuchObjectException() + self.o2.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.o3 = UnknownDBException() + self.o3.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.o4 = UnknownTableException() + self.o4.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.o5 = UnknownPartitionException() + self.o5.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.o6 = InvalidPartitionException() + self.o6.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('markPartitionForEvent_result') + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + if self.o2 != None: + oprot.writeFieldBegin('o2', TType.STRUCT, 2) + self.o2.write(oprot) + oprot.writeFieldEnd() + if self.o3 != None: + oprot.writeFieldBegin('o3', TType.STRUCT, 3) + self.o3.write(oprot) + oprot.writeFieldEnd() + if self.o4 != None: + oprot.writeFieldBegin('o4', TType.STRUCT, 4) + self.o4.write(oprot) + oprot.writeFieldEnd() + if self.o5 != None: + oprot.writeFieldBegin('o5', TType.STRUCT, 5) + self.o5.write(oprot) + oprot.writeFieldEnd() + if self.o6 != None: + oprot.writeFieldBegin('o6', TType.STRUCT, 6) + self.o6.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class isPartitionMarkedForEvent_args: + """ + Attributes: + - db_name + - tbl_name + - part_vals + - eventType + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'db_name', None, None, ), # 1 + (2, TType.STRING, 'tbl_name', None, None, ), # 2 + (3, TType.MAP, 'part_vals', (TType.STRING,None,TType.STRING,None), None, ), # 3 + (4, TType.I32, 'eventType', None, None, ), # 4 + ) + + def __init__(self, db_name=None, tbl_name=None, part_vals=None, eventType=None,): + self.db_name = db_name + self.tbl_name = tbl_name + self.part_vals = part_vals + self.eventType = eventType + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.db_name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tbl_name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.MAP: + self.part_vals = {} + (_ktype398, _vtype399, _size397 ) = iprot.readMapBegin() + for _i401 in xrange(_size397): + _key402 = iprot.readString(); + _val403 = iprot.readString(); + self.part_vals[_key402] = _val403 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.eventType = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('isPartitionMarkedForEvent_args') + if self.db_name != None: + oprot.writeFieldBegin('db_name', TType.STRING, 1) + oprot.writeString(self.db_name) + oprot.writeFieldEnd() + if self.tbl_name != None: + oprot.writeFieldBegin('tbl_name', TType.STRING, 2) + oprot.writeString(self.tbl_name) + oprot.writeFieldEnd() + if self.part_vals != None: + oprot.writeFieldBegin('part_vals', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.part_vals)) + for kiter404,viter405 in self.part_vals.items(): + oprot.writeString(kiter404) + oprot.writeString(viter405) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.eventType != None: + oprot.writeFieldBegin('eventType', TType.I32, 4) + oprot.writeI32(self.eventType) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class isPartitionMarkedForEvent_result: + """ + Attributes: + - success + - o1 + - o2 + - o3 + - o4 + - o5 + - o6 + """ + + thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (UnknownDBException, UnknownDBException.thrift_spec), None, ), # 3 + (4, TType.STRUCT, 'o4', (UnknownTableException, UnknownTableException.thrift_spec), None, ), # 4 + (5, TType.STRUCT, 'o5', (UnknownPartitionException, UnknownPartitionException.thrift_spec), None, ), # 5 + (6, TType.STRUCT, 'o6', (InvalidPartitionException, InvalidPartitionException.thrift_spec), None, ), # 6 + ) + + def __init__(self, success=None, o1=None, o2=None, o3=None, o4=None, o5=None, o6=None,): + self.success = success + self.o1 = o1 + self.o2 = o2 + self.o3 = o3 + self.o4 = o4 + self.o5 = o5 + self.o6 = o6 + + 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)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = NoSuchObjectException() + self.o2.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.o3 = UnknownDBException() + self.o3.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.o4 = UnknownTableException() + self.o4.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.o5 = UnknownPartitionException() + self.o5.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.o6 = InvalidPartitionException() + self.o6.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('isPartitionMarkedForEvent_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + if self.o2 != None: + oprot.writeFieldBegin('o2', TType.STRUCT, 2) + self.o2.write(oprot) + oprot.writeFieldEnd() + if self.o3 != None: + oprot.writeFieldBegin('o3', TType.STRUCT, 3) + self.o3.write(oprot) + oprot.writeFieldEnd() + if self.o4 != None: + oprot.writeFieldBegin('o4', TType.STRUCT, 4) + self.o4.write(oprot) + oprot.writeFieldEnd() + if self.o5 != None: + oprot.writeFieldBegin('o5', TType.STRUCT, 5) + self.o5.write(oprot) + oprot.writeFieldEnd() + if self.o6 != None: + oprot.writeFieldBegin('o6', TType.STRUCT, 6) + self.o6.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class add_index_args: """ Attributes: @@ -10813,11 +11448,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype391, _size388) = iprot.readListBegin() - for _i392 in xrange(_size388): - _elem393 = Index() - _elem393.read(iprot) - self.success.append(_elem393) + (_etype409, _size406) = iprot.readListBegin() + for _i410 in xrange(_size406): + _elem411 = Index() + _elem411.read(iprot) + self.success.append(_elem411) iprot.readListEnd() else: iprot.skip(ftype) @@ -10846,8 +11481,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter394 in self.success: - iter394.write(oprot) + for iter412 in self.success: + iter412.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -10986,10 +11621,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype398, _size395) = iprot.readListBegin() - for _i399 in xrange(_size395): - _elem400 = iprot.readString(); - self.success.append(_elem400) + (_etype416, _size413) = iprot.readListBegin() + for _i417 in xrange(_size413): + _elem418 = iprot.readString(); + self.success.append(_elem418) iprot.readListEnd() else: iprot.skip(ftype) @@ -11012,8 +11647,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter401 in self.success: - oprot.writeString(iter401) + for iter419 in self.success: + oprot.writeString(iter419) oprot.writeListEnd() oprot.writeFieldEnd() if self.o2 != None: @@ -11367,10 +12002,10 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype405, _size402) = iprot.readListBegin() - for _i406 in xrange(_size402): - _elem407 = iprot.readString(); - self.success.append(_elem407) + (_etype423, _size420) = iprot.readListBegin() + for _i424 in xrange(_size420): + _elem425 = iprot.readString(); + self.success.append(_elem425) iprot.readListEnd() else: iprot.skip(ftype) @@ -11393,8 +12028,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter408 in self.success: - oprot.writeString(iter408) + for iter426 in self.success: + oprot.writeString(iter426) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -11861,11 +12496,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype412, _size409) = iprot.readListBegin() - for _i413 in xrange(_size409): - _elem414 = Role() - _elem414.read(iprot) - self.success.append(_elem414) + (_etype430, _size427) = iprot.readListBegin() + for _i431 in xrange(_size427): + _elem432 = Role() + _elem432.read(iprot) + self.success.append(_elem432) iprot.readListEnd() else: iprot.skip(ftype) @@ -11888,8 +12523,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter415 in self.success: - iter415.write(oprot) + for iter433 in self.success: + iter433.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: @@ -11956,10 +12591,10 @@ elif fid == 3: if ftype == TType.LIST: self.group_names = [] - (_etype419, _size416) = iprot.readListBegin() - for _i420 in xrange(_size416): - _elem421 = iprot.readString(); - self.group_names.append(_elem421) + (_etype437, _size434) = iprot.readListBegin() + for _i438 in xrange(_size434): + _elem439 = iprot.readString(); + self.group_names.append(_elem439) iprot.readListEnd() else: iprot.skip(ftype) @@ -11984,8 +12619,8 @@ if self.group_names != None: oprot.writeFieldBegin('group_names', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.group_names)) - for iter422 in self.group_names: - oprot.writeString(iter422) + for iter440 in self.group_names: + oprot.writeString(iter440) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -12189,11 +12824,11 @@ if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype426, _size423) = iprot.readListBegin() - for _i427 in xrange(_size423): - _elem428 = HiveObjectPrivilege() - _elem428.read(iprot) - self.success.append(_elem428) + (_etype444, _size441) = iprot.readListBegin() + for _i445 in xrange(_size441): + _elem446 = HiveObjectPrivilege() + _elem446.read(iprot) + self.success.append(_elem446) iprot.readListEnd() else: iprot.skip(ftype) @@ -12216,8 +12851,8 @@ if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter429 in self.success: - iter429.write(oprot) + for iter447 in self.success: + iter447.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 != None: Index: metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote =================================================================== --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (revision 1136105) +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (working copy) @@ -60,6 +60,8 @@ print ' string get_config_value(string name, string defaultValue)' print ' partition_name_to_vals(string part_name)' print ' partition_name_to_spec(string part_name)' + print ' void markPartitionForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)' + print ' bool isPartitionMarkedForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)' print ' Index add_index(Index new_index, Table index_table)' print ' void alter_index(string dbname, string base_tbl_name, string idx_name, Index new_idx)' print ' bool drop_index_by_name(string db_name, string tbl_name, string index_name, bool deleteData)' @@ -363,6 +365,18 @@ sys.exit(1) pp.pprint(client.partition_name_to_spec(args[0],)) +elif cmd == 'markPartitionForEvent': + if len(args) != 4: + print 'markPartitionForEvent requires 4 args' + sys.exit(1) + pp.pprint(client.markPartitionForEvent(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'isPartitionMarkedForEvent': + if len(args) != 4: + print 'isPartitionMarkedForEvent requires 4 args' + sys.exit(1) + pp.pprint(client.isPartitionMarkedForEvent(args[0],args[1],eval(args[2]),eval(args[3]),)) + elif cmd == 'add_index': if len(args) != 2: print 'add_index requires 2 args' Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (revision 1136105) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (working copy) @@ -9299,6 +9299,696 @@ return xfer; } +uint32_t ThriftHiveMetastore_markPartitionForEvent_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->part_vals.clear(); + uint32_t _size445; + ::apache::thrift::protocol::TType _ktype446; + ::apache::thrift::protocol::TType _vtype447; + iprot->readMapBegin(_ktype446, _vtype447, _size445); + uint32_t _i449; + for (_i449 = 0; _i449 < _size445; ++_i449) + { + std::string _key450; + xfer += iprot->readString(_key450); + std::string& _val451 = this->part_vals[_key450]; + xfer += iprot->readString(_val451); + } + iprot->readMapEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast452; + xfer += iprot->readI32(ecast452); + this->eventType = (PartitionEventType::type)ecast452; + this->__isset.eventType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_args"); + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, this->part_vals.size()); + std::map ::const_iterator _iter453; + for (_iter453 = this->part_vals.begin(); _iter453 != this->part_vals.end(); ++_iter453) + { + xfer += oprot->writeString(_iter453->first); + xfer += oprot->writeString(_iter453->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->eventType); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_pargs"); + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); + std::map ::const_iterator _iter454; + for (_iter454 = (*(this->part_vals)).begin(); _iter454 != (*(this->part_vals)).end(); ++_iter454) + { + xfer += oprot->writeString(_iter454->first); + xfer += oprot->writeString(_iter454->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->eventType))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o5) { + xfer += oprot->writeFieldBegin("o5", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->o5.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o6) { + xfer += oprot->writeFieldBegin("o6", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->o6.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->part_vals.clear(); + uint32_t _size455; + ::apache::thrift::protocol::TType _ktype456; + ::apache::thrift::protocol::TType _vtype457; + iprot->readMapBegin(_ktype456, _vtype457, _size455); + uint32_t _i459; + for (_i459 = 0; _i459 < _size455; ++_i459) + { + std::string _key460; + xfer += iprot->readString(_key460); + std::string& _val461 = this->part_vals[_key460]; + xfer += iprot->readString(_val461); + } + iprot->readMapEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast462; + xfer += iprot->readI32(ecast462); + this->eventType = (PartitionEventType::type)ecast462; + this->__isset.eventType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_args"); + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, this->part_vals.size()); + std::map ::const_iterator _iter463; + for (_iter463 = this->part_vals.begin(); _iter463 != this->part_vals.end(); ++_iter463) + { + xfer += oprot->writeString(_iter463->first); + xfer += oprot->writeString(_iter463->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->eventType); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_pargs"); + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, (*(this->part_vals)).size()); + std::map ::const_iterator _iter464; + for (_iter464 = (*(this->part_vals)).begin(); _iter464 != (*(this->part_vals)).end(); ++_iter464) + { + xfer += oprot->writeString(_iter464->first); + xfer += oprot->writeString(_iter464->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->eventType))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o5) { + xfer += oprot->writeFieldBegin("o5", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->o5.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o6) { + xfer += oprot->writeFieldBegin("o6", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->o6.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t ThriftHiveMetastore_add_index_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -10331,14 +11021,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size445; - ::apache::thrift::protocol::TType _etype448; - iprot->readListBegin(_etype448, _size445); - this->success.resize(_size445); - uint32_t _i449; - for (_i449 = 0; _i449 < _size445; ++_i449) + uint32_t _size465; + ::apache::thrift::protocol::TType _etype468; + iprot->readListBegin(_etype468, _size465); + this->success.resize(_size465); + uint32_t _i469; + for (_i469 = 0; _i469 < _size465; ++_i469) { - xfer += this->success[_i449].read(iprot); + xfer += this->success[_i469].read(iprot); } iprot->readListEnd(); } @@ -10385,10 +11075,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter450; - for (_iter450 = this->success.begin(); _iter450 != this->success.end(); ++_iter450) + std::vector ::const_iterator _iter470; + for (_iter470 = this->success.begin(); _iter470 != this->success.end(); ++_iter470) { - xfer += (*_iter450).write(oprot); + xfer += (*_iter470).write(oprot); } xfer += oprot->writeListEnd(); } @@ -10431,14 +11121,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size451; - ::apache::thrift::protocol::TType _etype454; - iprot->readListBegin(_etype454, _size451); - (*(this->success)).resize(_size451); - uint32_t _i455; - for (_i455 = 0; _i455 < _size451; ++_i455) + uint32_t _size471; + ::apache::thrift::protocol::TType _etype474; + iprot->readListBegin(_etype474, _size471); + (*(this->success)).resize(_size471); + uint32_t _i475; + for (_i475 = 0; _i475 < _size471; ++_i475) { - xfer += (*(this->success))[_i455].read(iprot); + xfer += (*(this->success))[_i475].read(iprot); } iprot->readListEnd(); } @@ -10589,14 +11279,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size456; - ::apache::thrift::protocol::TType _etype459; - iprot->readListBegin(_etype459, _size456); - this->success.resize(_size456); - uint32_t _i460; - for (_i460 = 0; _i460 < _size456; ++_i460) + uint32_t _size476; + ::apache::thrift::protocol::TType _etype479; + iprot->readListBegin(_etype479, _size476); + this->success.resize(_size476); + uint32_t _i480; + for (_i480 = 0; _i480 < _size476; ++_i480) { - xfer += iprot->readString(this->success[_i460]); + xfer += iprot->readString(this->success[_i480]); } iprot->readListEnd(); } @@ -10635,10 +11325,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter461; - for (_iter461 = this->success.begin(); _iter461 != this->success.end(); ++_iter461) + std::vector ::const_iterator _iter481; + for (_iter481 = this->success.begin(); _iter481 != this->success.end(); ++_iter481) { - xfer += oprot->writeString((*_iter461)); + xfer += oprot->writeString((*_iter481)); } xfer += oprot->writeListEnd(); } @@ -10677,14 +11367,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size462; - ::apache::thrift::protocol::TType _etype465; - iprot->readListBegin(_etype465, _size462); - (*(this->success)).resize(_size462); - uint32_t _i466; - for (_i466 = 0; _i466 < _size462; ++_i466) + uint32_t _size482; + ::apache::thrift::protocol::TType _etype485; + iprot->readListBegin(_etype485, _size482); + (*(this->success)).resize(_size482); + uint32_t _i486; + for (_i486 = 0; _i486 < _size482; ++_i486) { - xfer += iprot->readString((*(this->success))[_i466]); + xfer += iprot->readString((*(this->success))[_i486]); } iprot->readListEnd(); } @@ -11141,14 +11831,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size467; - ::apache::thrift::protocol::TType _etype470; - iprot->readListBegin(_etype470, _size467); - this->success.resize(_size467); - uint32_t _i471; - for (_i471 = 0; _i471 < _size467; ++_i471) + uint32_t _size487; + ::apache::thrift::protocol::TType _etype490; + iprot->readListBegin(_etype490, _size487); + this->success.resize(_size487); + uint32_t _i491; + for (_i491 = 0; _i491 < _size487; ++_i491) { - xfer += iprot->readString(this->success[_i471]); + xfer += iprot->readString(this->success[_i491]); } iprot->readListEnd(); } @@ -11187,10 +11877,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->success.size()); - std::vector ::const_iterator _iter472; - for (_iter472 = this->success.begin(); _iter472 != this->success.end(); ++_iter472) + std::vector ::const_iterator _iter492; + for (_iter492 = this->success.begin(); _iter492 != this->success.end(); ++_iter492) { - xfer += oprot->writeString((*_iter472)); + xfer += oprot->writeString((*_iter492)); } xfer += oprot->writeListEnd(); } @@ -11229,14 +11919,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size473; - ::apache::thrift::protocol::TType _etype476; - iprot->readListBegin(_etype476, _size473); - (*(this->success)).resize(_size473); - uint32_t _i477; - for (_i477 = 0; _i477 < _size473; ++_i477) + uint32_t _size493; + ::apache::thrift::protocol::TType _etype496; + iprot->readListBegin(_etype496, _size493); + (*(this->success)).resize(_size493); + uint32_t _i497; + for (_i497 = 0; _i497 < _size493; ++_i497) { - xfer += iprot->readString((*(this->success))[_i477]); + xfer += iprot->readString((*(this->success))[_i497]); } iprot->readListEnd(); } @@ -11303,9 +11993,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast478; - xfer += iprot->readI32(ecast478); - this->principal_type = (PrincipalType::type)ecast478; + int32_t ecast498; + xfer += iprot->readI32(ecast498); + this->principal_type = (PrincipalType::type)ecast498; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -11321,9 +12011,9 @@ break; case 5: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast479; - xfer += iprot->readI32(ecast479); - this->grantorType = (PrincipalType::type)ecast479; + int32_t ecast499; + xfer += iprot->readI32(ecast499); + this->grantorType = (PrincipalType::type)ecast499; this->__isset.grantorType = true; } else { xfer += iprot->skip(ftype); @@ -11555,9 +12245,9 @@ break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast480; - xfer += iprot->readI32(ecast480); - this->principal_type = (PrincipalType::type)ecast480; + int32_t ecast500; + xfer += iprot->readI32(ecast500); + this->principal_type = (PrincipalType::type)ecast500; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -11755,9 +12445,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast481; - xfer += iprot->readI32(ecast481); - this->principal_type = (PrincipalType::type)ecast481; + int32_t ecast501; + xfer += iprot->readI32(ecast501); + this->principal_type = (PrincipalType::type)ecast501; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -11827,14 +12517,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size482; - ::apache::thrift::protocol::TType _etype485; - iprot->readListBegin(_etype485, _size482); - this->success.resize(_size482); - uint32_t _i486; - for (_i486 = 0; _i486 < _size482; ++_i486) + uint32_t _size502; + ::apache::thrift::protocol::TType _etype505; + iprot->readListBegin(_etype505, _size502); + this->success.resize(_size502); + uint32_t _i506; + for (_i506 = 0; _i506 < _size502; ++_i506) { - xfer += this->success[_i486].read(iprot); + xfer += this->success[_i506].read(iprot); } iprot->readListEnd(); } @@ -11873,10 +12563,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter487; - for (_iter487 = this->success.begin(); _iter487 != this->success.end(); ++_iter487) + std::vector ::const_iterator _iter507; + for (_iter507 = this->success.begin(); _iter507 != this->success.end(); ++_iter507) { - xfer += (*_iter487).write(oprot); + xfer += (*_iter507).write(oprot); } xfer += oprot->writeListEnd(); } @@ -11915,14 +12605,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size488; - ::apache::thrift::protocol::TType _etype491; - iprot->readListBegin(_etype491, _size488); - (*(this->success)).resize(_size488); - uint32_t _i492; - for (_i492 = 0; _i492 < _size488; ++_i492) + uint32_t _size508; + ::apache::thrift::protocol::TType _etype511; + iprot->readListBegin(_etype511, _size508); + (*(this->success)).resize(_size508); + uint32_t _i512; + for (_i512 = 0; _i512 < _size508; ++_i512) { - xfer += (*(this->success))[_i492].read(iprot); + xfer += (*(this->success))[_i512].read(iprot); } iprot->readListEnd(); } @@ -11991,14 +12681,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->group_names.clear(); - uint32_t _size493; - ::apache::thrift::protocol::TType _etype496; - iprot->readListBegin(_etype496, _size493); - this->group_names.resize(_size493); - uint32_t _i497; - for (_i497 = 0; _i497 < _size493; ++_i497) + uint32_t _size513; + ::apache::thrift::protocol::TType _etype516; + iprot->readListBegin(_etype516, _size513); + this->group_names.resize(_size513); + uint32_t _i517; + for (_i517 = 0; _i517 < _size513; ++_i517) { - xfer += iprot->readString(this->group_names[_i497]); + xfer += iprot->readString(this->group_names[_i517]); } iprot->readListEnd(); } @@ -12031,10 +12721,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->group_names.size()); - std::vector ::const_iterator _iter498; - for (_iter498 = this->group_names.begin(); _iter498 != this->group_names.end(); ++_iter498) + std::vector ::const_iterator _iter518; + for (_iter518 = this->group_names.begin(); _iter518 != this->group_names.end(); ++_iter518) { - xfer += oprot->writeString((*_iter498)); + xfer += oprot->writeString((*_iter518)); } xfer += oprot->writeListEnd(); } @@ -12056,10 +12746,10 @@ xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, (*(this->group_names)).size()); - std::vector ::const_iterator _iter499; - for (_iter499 = (*(this->group_names)).begin(); _iter499 != (*(this->group_names)).end(); ++_iter499) + std::vector ::const_iterator _iter519; + for (_iter519 = (*(this->group_names)).begin(); _iter519 != (*(this->group_names)).end(); ++_iter519) { - xfer += oprot->writeString((*_iter499)); + xfer += oprot->writeString((*_iter519)); } xfer += oprot->writeListEnd(); } @@ -12215,9 +12905,9 @@ break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast500; - xfer += iprot->readI32(ecast500); - this->principal_type = (PrincipalType::type)ecast500; + int32_t ecast520; + xfer += iprot->readI32(ecast520); + this->principal_type = (PrincipalType::type)ecast520; this->__isset.principal_type = true; } else { xfer += iprot->skip(ftype); @@ -12301,14 +12991,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); - uint32_t _size501; - ::apache::thrift::protocol::TType _etype504; - iprot->readListBegin(_etype504, _size501); - this->success.resize(_size501); - uint32_t _i505; - for (_i505 = 0; _i505 < _size501; ++_i505) + uint32_t _size521; + ::apache::thrift::protocol::TType _etype524; + iprot->readListBegin(_etype524, _size521); + this->success.resize(_size521); + uint32_t _i525; + for (_i525 = 0; _i525 < _size521; ++_i525) { - xfer += this->success[_i505].read(iprot); + xfer += this->success[_i525].read(iprot); } iprot->readListEnd(); } @@ -12347,10 +13037,10 @@ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->success.size()); - std::vector ::const_iterator _iter506; - for (_iter506 = this->success.begin(); _iter506 != this->success.end(); ++_iter506) + std::vector ::const_iterator _iter526; + for (_iter526 = this->success.begin(); _iter526 != this->success.end(); ++_iter526) { - xfer += (*_iter506).write(oprot); + xfer += (*_iter526).write(oprot); } xfer += oprot->writeListEnd(); } @@ -12389,14 +13079,14 @@ if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); - uint32_t _size507; - ::apache::thrift::protocol::TType _etype510; - iprot->readListBegin(_etype510, _size507); - (*(this->success)).resize(_size507); - uint32_t _i511; - for (_i511 = 0; _i511 < _size507; ++_i511) + uint32_t _size527; + ::apache::thrift::protocol::TType _etype530; + iprot->readListBegin(_etype530, _size527); + (*(this->success)).resize(_size527); + uint32_t _i531; + for (_i531 = 0; _i531 < _size527; ++_i531) { - xfer += (*(this->success))[_i511].read(iprot); + xfer += (*(this->success))[_i531].read(iprot); } iprot->readListEnd(); } @@ -15904,6 +16594,163 @@ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_spec failed: unknown result"); } +void ThriftHiveMetastoreClient::markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + recv_markPartitionForEvent(); +} + +void ThriftHiveMetastoreClient::send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_markPartitionForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_markPartitionForEvent() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("markPartitionForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_markPartitionForEvent_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + if (result.__isset.o5) { + throw result.o5; + } + if (result.__isset.o6) { + throw result.o6; + } + return; +} + +bool ThriftHiveMetastoreClient::isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + return recv_isPartitionMarkedForEvent(); +} + +void ThriftHiveMetastoreClient::send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_isPartitionMarkedForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +bool ThriftHiveMetastoreClient::recv_isPartitionMarkedForEvent() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("isPartitionMarkedForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + bool _return; + ThriftHiveMetastore_isPartitionMarkedForEvent_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + if (result.__isset.o5) { + throw result.o5; + } + if (result.__isset.o6) { + throw result.o6; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "isPartitionMarkedForEvent failed: unknown result"); +} + void ThriftHiveMetastoreClient::add_index(Index& _return, const Index& new_index, const Table& index_table) { send_add_index(new_index, index_table); @@ -18489,6 +19336,97 @@ oprot->getTransport()->writeEnd(); } +void ThriftHiveMetastoreProcessor::process_markPartitionForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_markPartitionForEvent_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_markPartitionForEvent_result result; + try { + iface_->markPartitionForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = o2; + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = o3; + result.__isset.o3 = true; + } catch (UnknownTableException &o4) { + result.o4 = o4; + result.__isset.o4 = true; + } catch (UnknownPartitionException &o5) { + result.o5 = o5; + result.__isset.o5 = true; + } catch (InvalidPartitionException &o6) { + result.o6 = o6; + result.__isset.o6 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreProcessor::process_isPartitionMarkedForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_isPartitionMarkedForEvent_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_isPartitionMarkedForEvent_result result; + try { + result.success = iface_->isPartitionMarkedForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = o2; + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = o3; + result.__isset.o3 = true; + } catch (UnknownTableException &o4) { + result.o4 = o4; + result.__isset.o4 = true; + } catch (UnknownPartitionException &o5) { + result.o5 = o5; + result.__isset.o5 = true; + } catch (InvalidPartitionException &o6) { + result.o6 = o6; + result.__isset.o6 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + void ThriftHiveMetastoreProcessor::process_add_index(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) { ThriftHiveMetastore_add_index_args args; Index: metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp (revision 1136105) +++ metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp (working copy) @@ -2365,6 +2365,114 @@ return xfer; } +const char* InvalidPartitionException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t InvalidPartitionException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + +uint32_t InvalidPartitionException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t InvalidPartitionException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("InvalidPartitionException"); + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* UnknownPartitionException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t UnknownPartitionException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + +uint32_t UnknownPartitionException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t UnknownPartitionException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("UnknownPartitionException"); + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + const char* InvalidObjectException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; const uint8_t InvalidObjectException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (revision 1136105) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (working copy) @@ -54,6 +54,8 @@ virtual void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) = 0; virtual void partition_name_to_vals(std::vector & _return, const std::string& part_name) = 0; virtual void partition_name_to_spec(std::map & _return, const std::string& part_name) = 0; + virtual void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) = 0; + virtual bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) = 0; virtual void add_index(Index& _return, const Index& new_index, const Table& index_table) = 0; virtual void alter_index(const std::string& dbname, const std::string& base_tbl_name, const std::string& idx_name, const Index& new_idx) = 0; virtual bool drop_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name, const bool deleteData) = 0; @@ -199,6 +201,13 @@ void partition_name_to_spec(std::map & /* _return */, const std::string& /* part_name */) { return; } + void markPartitionForEvent(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::map & /* part_vals */, const PartitionEventType::type /* eventType */) { + return; + } + bool isPartitionMarkedForEvent(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::map & /* part_vals */, const PartitionEventType::type /* eventType */) { + bool _return = false; + return _return; + } void add_index(Index& /* _return */, const Index& /* new_index */, const Table& /* index_table */) { return; } @@ -4867,6 +4876,302 @@ }; +typedef struct _ThriftHiveMetastore_markPartitionForEvent_args__isset { + _ThriftHiveMetastore_markPartitionForEvent_args__isset() : db_name(false), tbl_name(false), part_vals(false), eventType(false) {} + bool db_name; + bool tbl_name; + bool part_vals; + bool eventType; +} _ThriftHiveMetastore_markPartitionForEvent_args__isset; + +class ThriftHiveMetastore_markPartitionForEvent_args { + public: + + ThriftHiveMetastore_markPartitionForEvent_args() : db_name(""), tbl_name("") { + } + + virtual ~ThriftHiveMetastore_markPartitionForEvent_args() throw() {} + + std::string db_name; + std::string tbl_name; + std::map part_vals; + PartitionEventType::type eventType; + + _ThriftHiveMetastore_markPartitionForEvent_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_markPartitionForEvent_args & rhs) const + { + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (!(part_vals == rhs.part_vals)) + return false; + if (!(eventType == rhs.eventType)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_markPartitionForEvent_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_markPartitionForEvent_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_markPartitionForEvent_pargs { + public: + + + virtual ~ThriftHiveMetastore_markPartitionForEvent_pargs() throw() {} + + const std::string* db_name; + const std::string* tbl_name; + const std::map * part_vals; + const PartitionEventType::type* eventType; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_markPartitionForEvent_result__isset { + _ThriftHiveMetastore_markPartitionForEvent_result__isset() : o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool o1; + bool o2; + bool o3; + bool o4; + bool o5; + bool o6; +} _ThriftHiveMetastore_markPartitionForEvent_result__isset; + +class ThriftHiveMetastore_markPartitionForEvent_result { + public: + + ThriftHiveMetastore_markPartitionForEvent_result() { + } + + virtual ~ThriftHiveMetastore_markPartitionForEvent_result() throw() {} + + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_markPartitionForEvent_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_markPartitionForEvent_result & rhs) const + { + if (!(o1 == rhs.o1)) + return false; + if (!(o2 == rhs.o2)) + return false; + if (!(o3 == rhs.o3)) + return false; + if (!(o4 == rhs.o4)) + return false; + if (!(o5 == rhs.o5)) + return false; + if (!(o6 == rhs.o6)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_markPartitionForEvent_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_markPartitionForEvent_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_markPartitionForEvent_presult__isset { + _ThriftHiveMetastore_markPartitionForEvent_presult__isset() : o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool o1; + bool o2; + bool o3; + bool o4; + bool o5; + bool o6; +} _ThriftHiveMetastore_markPartitionForEvent_presult__isset; + +class ThriftHiveMetastore_markPartitionForEvent_presult { + public: + + + virtual ~ThriftHiveMetastore_markPartitionForEvent_presult() throw() {} + + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_markPartitionForEvent_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset() : db_name(false), tbl_name(false), part_vals(false), eventType(false) {} + bool db_name; + bool tbl_name; + bool part_vals; + bool eventType; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_args { + public: + + ThriftHiveMetastore_isPartitionMarkedForEvent_args() : db_name(""), tbl_name("") { + } + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_args() throw() {} + + std::string db_name; + std::string tbl_name; + std::map part_vals; + PartitionEventType::type eventType; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_isPartitionMarkedForEvent_args & rhs) const + { + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (!(part_vals == rhs.part_vals)) + return false; + if (!(eventType == rhs.eventType)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_isPartitionMarkedForEvent_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_isPartitionMarkedForEvent_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_isPartitionMarkedForEvent_pargs { + public: + + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_pargs() throw() {} + + const std::string* db_name; + const std::string* tbl_name; + const std::map * part_vals; + const PartitionEventType::type* eventType; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool success; + bool o1; + bool o2; + bool o3; + bool o4; + bool o5; + bool o6; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_result { + public: + + ThriftHiveMetastore_isPartitionMarkedForEvent_result() : success(0) { + } + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_result() throw() {} + + bool success; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_isPartitionMarkedForEvent_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + if (!(o2 == rhs.o2)) + return false; + if (!(o3 == rhs.o3)) + return false; + if (!(o4 == rhs.o4)) + return false; + if (!(o5 == rhs.o5)) + return false; + if (!(o6 == rhs.o6)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_isPartitionMarkedForEvent_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_isPartitionMarkedForEvent_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool success; + bool o1; + bool o2; + bool o3; + bool o4; + bool o5; + bool o6; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_presult { + public: + + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_presult() throw() {} + + bool* success; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _ThriftHiveMetastore_add_index_args__isset { _ThriftHiveMetastore_add_index_args__isset() : new_index(false), index_table(false) {} bool new_index; @@ -7154,6 +7459,12 @@ void partition_name_to_spec(std::map & _return, const std::string& part_name); void send_partition_name_to_spec(const std::string& part_name); void recv_partition_name_to_spec(std::map & _return); + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + void send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + void recv_markPartitionForEvent(); + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + void send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + bool recv_isPartitionMarkedForEvent(); void add_index(Index& _return, const Index& new_index, const Table& index_table); void send_add_index(const Index& new_index, const Table& index_table); void recv_add_index(Index& _return); @@ -7258,6 +7569,8 @@ void process_get_config_value(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_partition_name_to_vals(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_partition_name_to_spec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_markPartitionForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_isPartitionMarkedForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_add_index(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_alter_index(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_drop_index_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); @@ -7320,6 +7633,8 @@ processMap_["get_config_value"] = &ThriftHiveMetastoreProcessor::process_get_config_value; processMap_["partition_name_to_vals"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_vals; processMap_["partition_name_to_spec"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_spec; + processMap_["markPartitionForEvent"] = &ThriftHiveMetastoreProcessor::process_markPartitionForEvent; + processMap_["isPartitionMarkedForEvent"] = &ThriftHiveMetastoreProcessor::process_isPartitionMarkedForEvent; processMap_["add_index"] = &ThriftHiveMetastoreProcessor::process_add_index; processMap_["alter_index"] = &ThriftHiveMetastoreProcessor::process_alter_index; processMap_["drop_index_by_name"] = &ThriftHiveMetastoreProcessor::process_drop_index_by_name; @@ -7791,6 +8106,24 @@ } } + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + ifaces_[i]->markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + } + } + + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + return ifaces_[i]->isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + } else { + ifaces_[i]->isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + } + } + } + void add_index(Index& _return, const Index& new_index, const Table& index_table) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { Index: metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h =================================================================== --- metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h (revision 1136105) +++ metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h (working copy) @@ -34,6 +34,12 @@ }; }; +struct PartitionEventType { + enum type { + LOAD_DONE = 1 + }; +}; + typedef struct _Version__isset { _Version__isset() : version(false), comments(false) {} bool version; @@ -1087,6 +1093,80 @@ }; +typedef struct _InvalidPartitionException__isset { + _InvalidPartitionException__isset() : message(false) {} + bool message; +} _InvalidPartitionException__isset; + +class InvalidPartitionException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1"; + static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + + InvalidPartitionException() : message("") { + } + + virtual ~InvalidPartitionException() throw() {} + + std::string message; + + _InvalidPartitionException__isset __isset; + + bool operator == (const InvalidPartitionException & rhs) const + { + if (!(message == rhs.message)) + return false; + return true; + } + bool operator != (const InvalidPartitionException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidPartitionException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _UnknownPartitionException__isset { + _UnknownPartitionException__isset() : message(false) {} + bool message; +} _UnknownPartitionException__isset; + +class UnknownPartitionException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1"; + static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + + UnknownPartitionException() : message("") { + } + + virtual ~UnknownPartitionException() throw() {} + + std::string message; + + _UnknownPartitionException__isset __isset; + + bool operator == (const UnknownPartitionException & rhs) const + { + if (!(message == rhs.message)) + return false; + return true; + } + bool operator != (const UnknownPartitionException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnknownPartitionException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + typedef struct _InvalidObjectException__isset { _InvalidObjectException__isset() : message(false) {} bool message; Index: metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp =================================================================== --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (revision 1136105) +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (working copy) @@ -217,6 +217,16 @@ printf("partition_name_to_spec\n"); } + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) { + // Your implementation goes here + printf("markPartitionForEvent\n"); + } + + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) { + // Your implementation goes here + printf("isPartitionMarkedForEvent\n"); + } + void add_index(Index& _return, const Index& new_index, const Table& index_table) { // Your implementation goes here printf("add_index\n"); Index: metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb =================================================================== --- metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (revision 1136105) +++ metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (working copy) @@ -668,6 +668,47 @@ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'partition_name_to_spec failed: unknown result') end + def markPartitionForEvent(db_name, tbl_name, part_vals, eventType) + send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType) + recv_markPartitionForEvent() + end + + def send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType) + send_message('markPartitionForEvent', MarkPartitionForEvent_args, :db_name => db_name, :tbl_name => tbl_name, :part_vals => part_vals, :eventType => eventType) + end + + def recv_markPartitionForEvent() + result = receive_message(MarkPartitionForEvent_result) + raise result.o1 unless result.o1.nil? + raise result.o2 unless result.o2.nil? + raise result.o3 unless result.o3.nil? + raise result.o4 unless result.o4.nil? + raise result.o5 unless result.o5.nil? + raise result.o6 unless result.o6.nil? + return + end + + def isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType) + send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType) + return recv_isPartitionMarkedForEvent() + end + + def send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType) + send_message('isPartitionMarkedForEvent', IsPartitionMarkedForEvent_args, :db_name => db_name, :tbl_name => tbl_name, :part_vals => part_vals, :eventType => eventType) + end + + def recv_isPartitionMarkedForEvent() + result = receive_message(IsPartitionMarkedForEvent_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise result.o2 unless result.o2.nil? + raise result.o3 unless result.o3.nil? + raise result.o4 unless result.o4.nil? + raise result.o5 unless result.o5.nil? + raise result.o6 unless result.o6.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'isPartitionMarkedForEvent failed: unknown result') + end + def add_index(new_index, index_table) send_add_index(new_index, index_table) return recv_add_index() @@ -1488,6 +1529,48 @@ write_result(result, oprot, 'partition_name_to_spec', seqid) end + def process_markPartitionForEvent(seqid, iprot, oprot) + args = read_args(iprot, MarkPartitionForEvent_args) + result = MarkPartitionForEvent_result.new() + begin + @handler.markPartitionForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType) + rescue MetaException => o1 + result.o1 = o1 + rescue NoSuchObjectException => o2 + result.o2 = o2 + rescue UnknownDBException => o3 + result.o3 = o3 + rescue UnknownTableException => o4 + result.o4 = o4 + rescue UnknownPartitionException => o5 + result.o5 = o5 + rescue InvalidPartitionException => o6 + result.o6 = o6 + end + write_result(result, oprot, 'markPartitionForEvent', seqid) + end + + def process_isPartitionMarkedForEvent(seqid, iprot, oprot) + args = read_args(iprot, IsPartitionMarkedForEvent_args) + result = IsPartitionMarkedForEvent_result.new() + begin + result.success = @handler.isPartitionMarkedForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType) + rescue MetaException => o1 + result.o1 = o1 + rescue NoSuchObjectException => o2 + result.o2 = o2 + rescue UnknownDBException => o3 + result.o3 = o3 + rescue UnknownTableException => o4 + result.o4 = o4 + rescue UnknownPartitionException => o5 + result.o5 = o5 + rescue InvalidPartitionException => o6 + result.o6 = o6 + end + write_result(result, oprot, 'isPartitionMarkedForEvent', seqid) + end + def process_add_index(seqid, iprot, oprot) args = read_args(iprot, Add_index_args) result = Add_index_result.new() @@ -3216,6 +3299,110 @@ ::Thrift::Struct.generate_accessors self end + class MarkPartitionForEvent_args + include ::Thrift::Struct, ::Thrift::Struct_Union + DB_NAME = 1 + TBL_NAME = 2 + PART_VALS = 3 + EVENTTYPE = 4 + + FIELDS = { + DB_NAME => {:type => ::Thrift::Types::STRING, :name => 'db_name'}, + TBL_NAME => {:type => ::Thrift::Types::STRING, :name => 'tbl_name'}, + PART_VALS => {:type => ::Thrift::Types::MAP, :name => 'part_vals', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, + EVENTTYPE => {:type => ::Thrift::Types::I32, :name => 'eventType', :enum_class => PartitionEventType} + } + + def struct_fields; FIELDS; end + + def validate + unless @eventType.nil? || PartitionEventType::VALID_VALUES.include?(@eventType) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field eventType!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class MarkPartitionForEvent_result + include ::Thrift::Struct, ::Thrift::Struct_Union + O1 = 1 + O2 = 2 + O3 = 3 + O4 = 4 + O5 = 5 + O6 = 6 + + FIELDS = { + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException}, + O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => NoSuchObjectException}, + O3 => {:type => ::Thrift::Types::STRUCT, :name => 'o3', :class => UnknownDBException}, + O4 => {:type => ::Thrift::Types::STRUCT, :name => 'o4', :class => UnknownTableException}, + O5 => {:type => ::Thrift::Types::STRUCT, :name => 'o5', :class => UnknownPartitionException}, + O6 => {:type => ::Thrift::Types::STRUCT, :name => 'o6', :class => InvalidPartitionException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class IsPartitionMarkedForEvent_args + include ::Thrift::Struct, ::Thrift::Struct_Union + DB_NAME = 1 + TBL_NAME = 2 + PART_VALS = 3 + EVENTTYPE = 4 + + FIELDS = { + DB_NAME => {:type => ::Thrift::Types::STRING, :name => 'db_name'}, + TBL_NAME => {:type => ::Thrift::Types::STRING, :name => 'tbl_name'}, + PART_VALS => {:type => ::Thrift::Types::MAP, :name => 'part_vals', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, + EVENTTYPE => {:type => ::Thrift::Types::I32, :name => 'eventType', :enum_class => PartitionEventType} + } + + def struct_fields; FIELDS; end + + def validate + unless @eventType.nil? || PartitionEventType::VALID_VALUES.include?(@eventType) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field eventType!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class IsPartitionMarkedForEvent_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + O2 = 2 + O3 = 3 + O4 = 4 + O5 = 5 + O6 = 6 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException}, + O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => NoSuchObjectException}, + O3 => {:type => ::Thrift::Types::STRUCT, :name => 'o3', :class => UnknownDBException}, + O4 => {:type => ::Thrift::Types::STRUCT, :name => 'o4', :class => UnknownTableException}, + O5 => {:type => ::Thrift::Types::STRUCT, :name => 'o5', :class => UnknownPartitionException}, + O6 => {:type => ::Thrift::Types::STRUCT, :name => 'o6', :class => InvalidPartitionException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class Add_index_args include ::Thrift::Struct, ::Thrift::Struct_Union NEW_INDEX = 1 Index: metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb =================================================================== --- metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb (revision 1136105) +++ metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb (working copy) @@ -25,6 +25,12 @@ VALID_VALUES = Set.new([USER, ROLE, GROUP]).freeze end +module PartitionEventType + LOAD_DONE = 1 + VALUE_MAP = {1 => "LOAD_DONE"} + VALID_VALUES = Set.new([LOAD_DONE]).freeze +end + class Version include ::Thrift::Struct, ::Thrift::Struct_Union VERSION = 1 @@ -522,6 +528,48 @@ ::Thrift::Struct.generate_accessors self end +class InvalidPartitionException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.message = message + end + + MESSAGE = 1 + + FIELDS = { + MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class UnknownPartitionException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + def initialize(message=nil) + super() + self.message = message + end + + MESSAGE = 1 + + FIELDS = { + MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + class InvalidObjectException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) Index: metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/InvalidPartitionException.java =================================================================== --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/InvalidPartitionException.java (revision 0) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/InvalidPartitionException.java (revision 0) @@ -0,0 +1,306 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.*; +import org.apache.thrift.async.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.transport.*; +import org.apache.thrift.protocol.*; + +public class InvalidPartitionException extends Exception implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("InvalidPartitionException"); + + private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1); + + private String message; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(InvalidPartitionException.class, metaDataMap); + } + + public InvalidPartitionException() { + } + + public InvalidPartitionException( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public InvalidPartitionException(InvalidPartitionException other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public InvalidPartitionException deepCopy() { + return new InvalidPartitionException(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been asigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof InvalidPartitionException) + return this.equals((InvalidPartitionException)that); + return false; + } + + public boolean equals(InvalidPartitionException that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(InvalidPartitionException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + InvalidPartitionException typedOther = (InvalidPartitionException)other; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = TBaseHelper.compareTo(this.message, typedOther.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // MESSAGE + if (field.type == TType.STRING) { + this.message = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(this.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("InvalidPartitionException("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + Index: metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java =================================================================== --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (revision 1136105) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (working copy) @@ -111,6 +111,10 @@ public Map partition_name_to_spec(String part_name) throws MetaException, TException; + public void markPartitionForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException; + + public boolean isPartitionMarkedForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException; + public Index add_index(Index new_index, Table index_table) throws InvalidObjectException, AlreadyExistsException, MetaException, TException; public void alter_index(String dbname, String base_tbl_name, String idx_name, Index new_idx) throws InvalidOperationException, MetaException, TException; @@ -231,6 +235,10 @@ public void partition_name_to_spec(String part_name, AsyncMethodCallback resultHandler) throws TException; + public void markPartitionForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler) throws TException; + + public void isPartitionMarkedForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler) throws TException; + public void add_index(Index new_index, Table index_table, AsyncMethodCallback resultHandler) throws TException; public void alter_index(String dbname, String base_tbl_name, String idx_name, Index new_idx, AsyncMethodCallback resultHandler) throws TException; @@ -1965,6 +1973,117 @@ throw new TApplicationException(TApplicationException.MISSING_RESULT, "partition_name_to_spec failed: unknown result"); } + public void markPartitionForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException + { + send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + recv_markPartitionForEvent(); + } + + public void send_markPartitionForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws TException + { + oprot_.writeMessageBegin(new TMessage("markPartitionForEvent", TMessageType.CALL, ++seqid_)); + markPartitionForEvent_args args = new markPartitionForEvent_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setPart_vals(part_vals); + args.setEventType(eventType); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public void recv_markPartitionForEvent() throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "markPartitionForEvent failed: out of sequence response"); + } + markPartitionForEvent_result result = new markPartitionForEvent_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.o1 != null) { + throw result.o1; + } + if (result.o2 != null) { + throw result.o2; + } + if (result.o3 != null) { + throw result.o3; + } + if (result.o4 != null) { + throw result.o4; + } + if (result.o5 != null) { + throw result.o5; + } + if (result.o6 != null) { + throw result.o6; + } + return; + } + + public boolean isPartitionMarkedForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException + { + send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + return recv_isPartitionMarkedForEvent(); + } + + public void send_isPartitionMarkedForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType) throws TException + { + oprot_.writeMessageBegin(new TMessage("isPartitionMarkedForEvent", TMessageType.CALL, ++seqid_)); + isPartitionMarkedForEvent_args args = new isPartitionMarkedForEvent_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setPart_vals(part_vals); + args.setEventType(eventType); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_isPartitionMarkedForEvent() throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "isPartitionMarkedForEvent failed: out of sequence response"); + } + isPartitionMarkedForEvent_result result = new isPartitionMarkedForEvent_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + if (result.o2 != null) { + throw result.o2; + } + if (result.o3 != null) { + throw result.o3; + } + if (result.o4 != null) { + throw result.o4; + } + if (result.o5 != null) { + throw result.o5; + } + if (result.o6 != null) { + throw result.o6; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "isPartitionMarkedForEvent failed: unknown result"); + } + public Index add_index(Index new_index, Table index_table) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { send_add_index(new_index, index_table); @@ -4138,6 +4257,86 @@ } } + public void markPartitionForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + markPartitionForEvent_call method_call = new markPartitionForEvent_call(db_name, tbl_name, part_vals, eventType, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class markPartitionForEvent_call extends TAsyncMethodCall { + private String db_name; + private String tbl_name; + private Map part_vals; + private PartitionEventType eventType; + public markPartitionForEvent_call(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.eventType = eventType; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("markPartitionForEvent", TMessageType.CALL, 0)); + markPartitionForEvent_args args = new markPartitionForEvent_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setPart_vals(part_vals); + args.setEventType(eventType); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_markPartitionForEvent(); + } + } + + public void isPartitionMarkedForEvent(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + isPartitionMarkedForEvent_call method_call = new isPartitionMarkedForEvent_call(db_name, tbl_name, part_vals, eventType, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class isPartitionMarkedForEvent_call extends TAsyncMethodCall { + private String db_name; + private String tbl_name; + private Map part_vals; + private PartitionEventType eventType; + public isPartitionMarkedForEvent_call(String db_name, String tbl_name, Map part_vals, PartitionEventType eventType, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.eventType = eventType; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("isPartitionMarkedForEvent", TMessageType.CALL, 0)); + isPartitionMarkedForEvent_args args = new isPartitionMarkedForEvent_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setPart_vals(part_vals); + args.setEventType(eventType); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_isPartitionMarkedForEvent(); + } + } + public void add_index(Index new_index, Table index_table, AsyncMethodCallback resultHandler) throws TException { checkReady(); add_index_call method_call = new add_index_call(new_index, index_table, resultHandler, this, protocolFactory, transport); @@ -4849,6 +5048,8 @@ processMap_.put("get_config_value", new get_config_value()); processMap_.put("partition_name_to_vals", new partition_name_to_vals()); processMap_.put("partition_name_to_spec", new partition_name_to_spec()); + processMap_.put("markPartitionForEvent", new markPartitionForEvent()); + processMap_.put("isPartitionMarkedForEvent", new isPartitionMarkedForEvent()); processMap_.put("add_index", new add_index()); processMap_.put("alter_index", new alter_index()); processMap_.put("drop_index_by_name", new drop_index_by_name()); @@ -6454,6 +6655,103 @@ } + private class markPartitionForEvent implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + markPartitionForEvent_args args = new markPartitionForEvent_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("markPartitionForEvent", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + markPartitionForEvent_result result = new markPartitionForEvent_result(); + try { + iface_.markPartitionForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (UnknownDBException o3) { + result.o3 = o3; + } catch (UnknownTableException o4) { + result.o4 = o4; + } catch (UnknownPartitionException o5) { + result.o5 = o5; + } catch (InvalidPartitionException o6) { + result.o6 = o6; + } catch (Throwable th) { + LOGGER.error("Internal error processing markPartitionForEvent", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing markPartitionForEvent"); + oprot.writeMessageBegin(new TMessage("markPartitionForEvent", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("markPartitionForEvent", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class isPartitionMarkedForEvent implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + isPartitionMarkedForEvent_args args = new isPartitionMarkedForEvent_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("isPartitionMarkedForEvent", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + isPartitionMarkedForEvent_result result = new isPartitionMarkedForEvent_result(); + try { + result.success = iface_.isPartitionMarkedForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + result.setSuccessIsSet(true); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (UnknownDBException o3) { + result.o3 = o3; + } catch (UnknownTableException o4) { + result.o4 = o4; + } catch (UnknownPartitionException o5) { + result.o5 = o5; + } catch (InvalidPartitionException o6) { + result.o6 = o6; + } catch (Throwable th) { + LOGGER.error("Internal error processing isPartitionMarkedForEvent", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing isPartitionMarkedForEvent"); + oprot.writeMessageBegin(new TMessage("isPartitionMarkedForEvent", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("isPartitionMarkedForEvent", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class add_index implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { @@ -41159,6 +41457,2727 @@ } + public static class markPartitionForEvent_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("markPartitionForEvent_args"); + + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.MAP, (short)3); + private static final TField EVENT_TYPE_FIELD_DESC = new TField("eventType", TType.I32, (short)4); + + private String db_name; + private String tbl_name; + private Map part_vals; + private PartitionEventType eventType; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + DB_NAME((short)1, "db_name"), + TBL_NAME((short)2, "tbl_name"), + PART_VALS((short)3, "part_vals"), + /** + * + * @see PartitionEventType + */ + EVENT_TYPE((short)4, "eventType"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // DB_NAME + return DB_NAME; + case 2: // TBL_NAME + return TBL_NAME; + case 3: // PART_VALS + return PART_VALS; + case 4: // EVENT_TYPE + return EVENT_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.EVENT_TYPE, new FieldMetaData("eventType", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, PartitionEventType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(markPartitionForEvent_args.class, metaDataMap); + } + + public markPartitionForEvent_args() { + } + + public markPartitionForEvent_args( + String db_name, + String tbl_name, + Map part_vals, + PartitionEventType eventType) + { + this(); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.eventType = eventType; + } + + /** + * Performs a deep copy on other. + */ + public markPartitionForEvent_args(markPartitionForEvent_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + Map __this__part_vals = new HashMap(); + for (Map.Entry other_element : other.part_vals.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__part_vals_copy_key = other_element_key; + + String __this__part_vals_copy_value = other_element_value; + + __this__part_vals.put(__this__part_vals_copy_key, __this__part_vals_copy_value); + } + this.part_vals = __this__part_vals; + } + if (other.isSetEventType()) { + this.eventType = other.eventType; + } + } + + public markPartitionForEvent_args deepCopy() { + return new markPartitionForEvent_args(this); + } + + @Override + public void clear() { + this.db_name = null; + this.tbl_name = null; + this.part_vals = null; + this.eventType = null; + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + /** Returns true if field db_name is set (has been asigned a value) and false otherwise */ + public boolean isSetDb_name() { + return this.db_name != null; + } + + public void setDb_nameIsSet(boolean value) { + if (!value) { + this.db_name = null; + } + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + /** Returns true if field tbl_name is set (has been asigned a value) and false otherwise */ + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public void setTbl_nameIsSet(boolean value) { + if (!value) { + this.tbl_name = null; + } + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public void putToPart_vals(String key, String val) { + if (this.part_vals == null) { + this.part_vals = new HashMap(); + } + this.part_vals.put(key, val); + } + + public Map getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(Map part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + /** Returns true if field part_vals is set (has been asigned a value) and false otherwise */ + public boolean isSetPart_vals() { + return this.part_vals != null; + } + + public void setPart_valsIsSet(boolean value) { + if (!value) { + this.part_vals = null; + } + } + + /** + * + * @see PartitionEventType + */ + public PartitionEventType getEventType() { + return this.eventType; + } + + /** + * + * @see PartitionEventType + */ + public void setEventType(PartitionEventType eventType) { + this.eventType = eventType; + } + + public void unsetEventType() { + this.eventType = null; + } + + /** Returns true if field eventType is set (has been asigned a value) and false otherwise */ + public boolean isSetEventType() { + return this.eventType != null; + } + + public void setEventTypeIsSet(boolean value) { + if (!value) { + this.eventType = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((Map)value); + } + break; + + case EVENT_TYPE: + if (value == null) { + unsetEventType(); + } else { + setEventType((PartitionEventType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); + + case EVENT_TYPE: + return getEventType(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); + case EVENT_TYPE: + return isSetEventType(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof markPartitionForEvent_args) + return this.equals((markPartitionForEvent_args)that); + return false; + } + + public boolean equals(markPartitionForEvent_args that) { + if (that == null) + return false; + + boolean this_present_db_name = true && this.isSetDb_name(); + boolean that_present_db_name = true && that.isSetDb_name(); + if (this_present_db_name || that_present_db_name) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_eventType = true && this.isSetEventType(); + boolean that_present_eventType = true && that.isSetEventType(); + if (this_present_eventType || that_present_eventType) { + if (!(this_present_eventType && that_present_eventType)) + return false; + if (!this.eventType.equals(that.eventType)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(markPartitionForEvent_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + markPartitionForEvent_args typedOther = (markPartitionForEvent_args)other; + + lastComparison = Boolean.valueOf(isSetDb_name()).compareTo(typedOther.isSetDb_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDb_name()) { + lastComparison = TBaseHelper.compareTo(this.db_name, typedOther.db_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTbl_name()).compareTo(typedOther.isSetTbl_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTbl_name()) { + lastComparison = TBaseHelper.compareTo(this.tbl_name, typedOther.tbl_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(typedOther.isSetPart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPart_vals()) { + lastComparison = TBaseHelper.compareTo(this.part_vals, typedOther.part_vals); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEventType()) { + lastComparison = TBaseHelper.compareTo(this.eventType, typedOther.eventType); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // DB_NAME + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // TBL_NAME + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // PART_VALS + if (field.type == TType.MAP) { + { + TMap _map220 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map220.size); + for (int _i221 = 0; _i221 < _map220.size; ++_i221) + { + String _key222; + String _val223; + _key222 = iprot.readString(); + _val223 = iprot.readString(); + this.part_vals.put(_key222, _val223); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // EVENT_TYPE + if (field.type == TType.I32) { + this.eventType = PartitionEventType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.part_vals.size())); + for (Map.Entry _iter224 : this.part_vals.entrySet()) + { + oprot.writeString(_iter224.getKey()); + oprot.writeString(_iter224.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.eventType != null) { + oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC); + oprot.writeI32(this.eventType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("markPartitionForEvent_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; + if (!first) sb.append(", "); + sb.append("eventType:"); + if (this.eventType == null) { + sb.append("null"); + } else { + sb.append(this.eventType); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class markPartitionForEvent_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("markPartitionForEvent_result"); + + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); + private static final TField O5_FIELD_DESC = new TField("o5", TType.STRUCT, (short)5); + private static final TField O6_FIELD_DESC = new TField("o6", TType.STRUCT, (short)6); + + private MetaException o1; + private NoSuchObjectException o2; + private UnknownDBException o3; + private UnknownTableException o4; + private UnknownPartitionException o5; + private InvalidPartitionException o6; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + O1((short)1, "o1"), + O2((short)2, "o2"), + O3((short)3, "o3"), + O4((short)4, "o4"), + O5((short)5, "o5"), + O6((short)6, "o6"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // O1 + return O1; + case 2: // O2 + return O2; + case 3: // O3 + return O3; + case 4: // O4 + return O4; + case 5: // O5 + return O5; + case 6: // O6 + return O6; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O5, new FieldMetaData("o5", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O6, new FieldMetaData("o6", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(markPartitionForEvent_result.class, metaDataMap); + } + + public markPartitionForEvent_result() { + } + + public markPartitionForEvent_result( + MetaException o1, + NoSuchObjectException o2, + UnknownDBException o3, + UnknownTableException o4, + UnknownPartitionException o5, + InvalidPartitionException o6) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + this.o4 = o4; + this.o5 = o5; + this.o6 = o6; + } + + /** + * Performs a deep copy on other. + */ + public markPartitionForEvent_result(markPartitionForEvent_result other) { + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new UnknownDBException(other.o3); + } + if (other.isSetO4()) { + this.o4 = new UnknownTableException(other.o4); + } + if (other.isSetO5()) { + this.o5 = new UnknownPartitionException(other.o5); + } + if (other.isSetO6()) { + this.o6 = new InvalidPartitionException(other.o6); + } + } + + public markPartitionForEvent_result deepCopy() { + return new markPartitionForEvent_result(this); + } + + @Override + public void clear() { + this.o1 = null; + this.o2 = null; + this.o3 = null; + this.o4 = null; + this.o5 = null; + this.o6 = null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + /** Returns true if field o1 is set (has been asigned a value) and false otherwise */ + public boolean isSetO1() { + return this.o1 != null; + } + + public void setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + /** Returns true if field o2 is set (has been asigned a value) and false otherwise */ + public boolean isSetO2() { + return this.o2 != null; + } + + public void setO2IsSet(boolean value) { + if (!value) { + this.o2 = null; + } + } + + public UnknownDBException getO3() { + return this.o3; + } + + public void setO3(UnknownDBException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + /** Returns true if field o3 is set (has been asigned a value) and false otherwise */ + public boolean isSetO3() { + return this.o3 != null; + } + + public void setO3IsSet(boolean value) { + if (!value) { + this.o3 = null; + } + } + + public UnknownTableException getO4() { + return this.o4; + } + + public void setO4(UnknownTableException o4) { + this.o4 = o4; + } + + public void unsetO4() { + this.o4 = null; + } + + /** Returns true if field o4 is set (has been asigned a value) and false otherwise */ + public boolean isSetO4() { + return this.o4 != null; + } + + public void setO4IsSet(boolean value) { + if (!value) { + this.o4 = null; + } + } + + public UnknownPartitionException getO5() { + return this.o5; + } + + public void setO5(UnknownPartitionException o5) { + this.o5 = o5; + } + + public void unsetO5() { + this.o5 = null; + } + + /** Returns true if field o5 is set (has been asigned a value) and false otherwise */ + public boolean isSetO5() { + return this.o5 != null; + } + + public void setO5IsSet(boolean value) { + if (!value) { + this.o5 = null; + } + } + + public InvalidPartitionException getO6() { + return this.o6; + } + + public void setO6(InvalidPartitionException o6) { + this.o6 = o6; + } + + public void unsetO6() { + this.o6 = null; + } + + /** Returns true if field o6 is set (has been asigned a value) and false otherwise */ + public boolean isSetO6() { + return this.o6 != null; + } + + public void setO6IsSet(boolean value) { + if (!value) { + this.o6 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((UnknownDBException)value); + } + break; + + case O4: + if (value == null) { + unsetO4(); + } else { + setO4((UnknownTableException)value); + } + break; + + case O5: + if (value == null) { + unsetO5(); + } else { + setO5((UnknownPartitionException)value); + } + break; + + case O6: + if (value == null) { + unsetO6(); + } else { + setO6((InvalidPartitionException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + case O4: + return getO4(); + + case O5: + return getO5(); + + case O6: + return getO6(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + case O4: + return isSetO4(); + case O5: + return isSetO5(); + case O6: + return isSetO6(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof markPartitionForEvent_result) + return this.equals((markPartitionForEvent_result)that); + return false; + } + + public boolean equals(markPartitionForEvent_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + boolean this_present_o4 = true && this.isSetO4(); + boolean that_present_o4 = true && that.isSetO4(); + if (this_present_o4 || that_present_o4) { + if (!(this_present_o4 && that_present_o4)) + return false; + if (!this.o4.equals(that.o4)) + return false; + } + + boolean this_present_o5 = true && this.isSetO5(); + boolean that_present_o5 = true && that.isSetO5(); + if (this_present_o5 || that_present_o5) { + if (!(this_present_o5 && that_present_o5)) + return false; + if (!this.o5.equals(that.o5)) + return false; + } + + boolean this_present_o6 = true && this.isSetO6(); + boolean that_present_o6 = true && that.isSetO6(); + if (this_present_o6 || that_present_o6) { + if (!(this_present_o6 && that_present_o6)) + return false; + if (!this.o6.equals(that.o6)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(markPartitionForEvent_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + markPartitionForEvent_result typedOther = (markPartitionForEvent_result)other; + + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO2()).compareTo(typedOther.isSetO2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO2()) { + lastComparison = TBaseHelper.compareTo(this.o2, typedOther.o2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO3()).compareTo(typedOther.isSetO3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO3()) { + lastComparison = TBaseHelper.compareTo(this.o3, typedOther.o3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO4()).compareTo(typedOther.isSetO4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO4()) { + lastComparison = TBaseHelper.compareTo(this.o4, typedOther.o4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO5()).compareTo(typedOther.isSetO5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO5()) { + lastComparison = TBaseHelper.compareTo(this.o5, typedOther.o5); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO6()).compareTo(typedOther.isSetO6()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO6()) { + lastComparison = TBaseHelper.compareTo(this.o6, typedOther.o6); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // O1 + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // O2 + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // O3 + if (field.type == TType.STRUCT) { + this.o3 = new UnknownDBException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // O4 + if (field.type == TType.STRUCT) { + this.o4 = new UnknownTableException(); + this.o4.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // O5 + if (field.type == TType.STRUCT) { + this.o5 = new UnknownPartitionException(); + this.o5.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 6: // O6 + if (field.type == TType.STRUCT) { + this.o6 = new InvalidPartitionException(); + this.o6.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO4()) { + oprot.writeFieldBegin(O4_FIELD_DESC); + this.o4.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO5()) { + oprot.writeFieldBegin(O5_FIELD_DESC); + this.o5.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO6()) { + oprot.writeFieldBegin(O6_FIELD_DESC); + this.o6.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("markPartitionForEvent_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + if (!first) sb.append(", "); + sb.append("o4:"); + if (this.o4 == null) { + sb.append("null"); + } else { + sb.append(this.o4); + } + first = false; + if (!first) sb.append(", "); + sb.append("o5:"); + if (this.o5 == null) { + sb.append("null"); + } else { + sb.append(this.o5); + } + first = false; + if (!first) sb.append(", "); + sb.append("o6:"); + if (this.o6 == null) { + sb.append("null"); + } else { + sb.append(this.o6); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class isPartitionMarkedForEvent_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("isPartitionMarkedForEvent_args"); + + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.MAP, (short)3); + private static final TField EVENT_TYPE_FIELD_DESC = new TField("eventType", TType.I32, (short)4); + + private String db_name; + private String tbl_name; + private Map part_vals; + private PartitionEventType eventType; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + DB_NAME((short)1, "db_name"), + TBL_NAME((short)2, "tbl_name"), + PART_VALS((short)3, "part_vals"), + /** + * + * @see PartitionEventType + */ + EVENT_TYPE((short)4, "eventType"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // DB_NAME + return DB_NAME; + case 2: // TBL_NAME + return TBL_NAME; + case 3: // PART_VALS + return PART_VALS; + case 4: // EVENT_TYPE + return EVENT_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.EVENT_TYPE, new FieldMetaData("eventType", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, PartitionEventType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(isPartitionMarkedForEvent_args.class, metaDataMap); + } + + public isPartitionMarkedForEvent_args() { + } + + public isPartitionMarkedForEvent_args( + String db_name, + String tbl_name, + Map part_vals, + PartitionEventType eventType) + { + this(); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.eventType = eventType; + } + + /** + * Performs a deep copy on other. + */ + public isPartitionMarkedForEvent_args(isPartitionMarkedForEvent_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + Map __this__part_vals = new HashMap(); + for (Map.Entry other_element : other.part_vals.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__part_vals_copy_key = other_element_key; + + String __this__part_vals_copy_value = other_element_value; + + __this__part_vals.put(__this__part_vals_copy_key, __this__part_vals_copy_value); + } + this.part_vals = __this__part_vals; + } + if (other.isSetEventType()) { + this.eventType = other.eventType; + } + } + + public isPartitionMarkedForEvent_args deepCopy() { + return new isPartitionMarkedForEvent_args(this); + } + + @Override + public void clear() { + this.db_name = null; + this.tbl_name = null; + this.part_vals = null; + this.eventType = null; + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + /** Returns true if field db_name is set (has been asigned a value) and false otherwise */ + public boolean isSetDb_name() { + return this.db_name != null; + } + + public void setDb_nameIsSet(boolean value) { + if (!value) { + this.db_name = null; + } + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + /** Returns true if field tbl_name is set (has been asigned a value) and false otherwise */ + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public void setTbl_nameIsSet(boolean value) { + if (!value) { + this.tbl_name = null; + } + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public void putToPart_vals(String key, String val) { + if (this.part_vals == null) { + this.part_vals = new HashMap(); + } + this.part_vals.put(key, val); + } + + public Map getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(Map part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + /** Returns true if field part_vals is set (has been asigned a value) and false otherwise */ + public boolean isSetPart_vals() { + return this.part_vals != null; + } + + public void setPart_valsIsSet(boolean value) { + if (!value) { + this.part_vals = null; + } + } + + /** + * + * @see PartitionEventType + */ + public PartitionEventType getEventType() { + return this.eventType; + } + + /** + * + * @see PartitionEventType + */ + public void setEventType(PartitionEventType eventType) { + this.eventType = eventType; + } + + public void unsetEventType() { + this.eventType = null; + } + + /** Returns true if field eventType is set (has been asigned a value) and false otherwise */ + public boolean isSetEventType() { + return this.eventType != null; + } + + public void setEventTypeIsSet(boolean value) { + if (!value) { + this.eventType = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((Map)value); + } + break; + + case EVENT_TYPE: + if (value == null) { + unsetEventType(); + } else { + setEventType((PartitionEventType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); + + case EVENT_TYPE: + return getEventType(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); + case EVENT_TYPE: + return isSetEventType(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isPartitionMarkedForEvent_args) + return this.equals((isPartitionMarkedForEvent_args)that); + return false; + } + + public boolean equals(isPartitionMarkedForEvent_args that) { + if (that == null) + return false; + + boolean this_present_db_name = true && this.isSetDb_name(); + boolean that_present_db_name = true && that.isSetDb_name(); + if (this_present_db_name || that_present_db_name) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_eventType = true && this.isSetEventType(); + boolean that_present_eventType = true && that.isSetEventType(); + if (this_present_eventType || that_present_eventType) { + if (!(this_present_eventType && that_present_eventType)) + return false; + if (!this.eventType.equals(that.eventType)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(isPartitionMarkedForEvent_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + isPartitionMarkedForEvent_args typedOther = (isPartitionMarkedForEvent_args)other; + + lastComparison = Boolean.valueOf(isSetDb_name()).compareTo(typedOther.isSetDb_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDb_name()) { + lastComparison = TBaseHelper.compareTo(this.db_name, typedOther.db_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTbl_name()).compareTo(typedOther.isSetTbl_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTbl_name()) { + lastComparison = TBaseHelper.compareTo(this.tbl_name, typedOther.tbl_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(typedOther.isSetPart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPart_vals()) { + lastComparison = TBaseHelper.compareTo(this.part_vals, typedOther.part_vals); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEventType()) { + lastComparison = TBaseHelper.compareTo(this.eventType, typedOther.eventType); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // DB_NAME + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // TBL_NAME + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // PART_VALS + if (field.type == TType.MAP) { + { + TMap _map225 = iprot.readMapBegin(); + this.part_vals = new HashMap(2*_map225.size); + for (int _i226 = 0; _i226 < _map225.size; ++_i226) + { + String _key227; + String _val228; + _key227 = iprot.readString(); + _val228 = iprot.readString(); + this.part_vals.put(_key227, _val228); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // EVENT_TYPE + if (field.type == TType.I32) { + this.eventType = PartitionEventType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.part_vals.size())); + for (Map.Entry _iter229 : this.part_vals.entrySet()) + { + oprot.writeString(_iter229.getKey()); + oprot.writeString(_iter229.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.eventType != null) { + oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC); + oprot.writeI32(this.eventType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("isPartitionMarkedForEvent_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; + if (!first) sb.append(", "); + sb.append("eventType:"); + if (this.eventType == null) { + sb.append("null"); + } else { + sb.append(this.eventType); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class isPartitionMarkedForEvent_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("isPartitionMarkedForEvent_result"); + + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); + private static final TField O5_FIELD_DESC = new TField("o5", TType.STRUCT, (short)5); + private static final TField O6_FIELD_DESC = new TField("o6", TType.STRUCT, (short)6); + + private boolean success; + private MetaException o1; + private NoSuchObjectException o2; + private UnknownDBException o3; + private UnknownTableException o4; + private UnknownPartitionException o5; + private InvalidPartitionException o6; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"), + O2((short)2, "o2"), + O3((short)3, "o3"), + O4((short)4, "o4"), + O5((short)5, "o5"), + O6((short)6, "o6"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + case 2: // O2 + return O2; + case 3: // O3 + return O3; + case 4: // O4 + return O4; + case 5: // O5 + return O5; + case 6: // O6 + return O6; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O5, new FieldMetaData("o5", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + tmpMap.put(_Fields.O6, new FieldMetaData("o6", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(isPartitionMarkedForEvent_result.class, metaDataMap); + } + + public isPartitionMarkedForEvent_result() { + } + + public isPartitionMarkedForEvent_result( + boolean success, + MetaException o1, + NoSuchObjectException o2, + UnknownDBException o3, + UnknownTableException o4, + UnknownPartitionException o5, + InvalidPartitionException o6) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + this.o4 = o4; + this.o5 = o5; + this.o6 = o6; + } + + /** + * Performs a deep copy on other. + */ + public isPartitionMarkedForEvent_result(isPartitionMarkedForEvent_result other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new UnknownDBException(other.o3); + } + if (other.isSetO4()) { + this.o4 = new UnknownTableException(other.o4); + } + if (other.isSetO5()) { + this.o5 = new UnknownPartitionException(other.o5); + } + if (other.isSetO6()) { + this.o6 = new InvalidPartitionException(other.o6); + } + } + + public isPartitionMarkedForEvent_result deepCopy() { + return new isPartitionMarkedForEvent_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.o1 = null; + this.o2 = null; + this.o3 = null; + this.o4 = null; + this.o5 = null; + this.o6 = null; + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + } + + public void unsetSuccess() { + __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been asigned a value) and false otherwise */ + public boolean isSetSuccess() { + return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + /** Returns true if field o1 is set (has been asigned a value) and false otherwise */ + public boolean isSetO1() { + return this.o1 != null; + } + + public void setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + /** Returns true if field o2 is set (has been asigned a value) and false otherwise */ + public boolean isSetO2() { + return this.o2 != null; + } + + public void setO2IsSet(boolean value) { + if (!value) { + this.o2 = null; + } + } + + public UnknownDBException getO3() { + return this.o3; + } + + public void setO3(UnknownDBException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + /** Returns true if field o3 is set (has been asigned a value) and false otherwise */ + public boolean isSetO3() { + return this.o3 != null; + } + + public void setO3IsSet(boolean value) { + if (!value) { + this.o3 = null; + } + } + + public UnknownTableException getO4() { + return this.o4; + } + + public void setO4(UnknownTableException o4) { + this.o4 = o4; + } + + public void unsetO4() { + this.o4 = null; + } + + /** Returns true if field o4 is set (has been asigned a value) and false otherwise */ + public boolean isSetO4() { + return this.o4 != null; + } + + public void setO4IsSet(boolean value) { + if (!value) { + this.o4 = null; + } + } + + public UnknownPartitionException getO5() { + return this.o5; + } + + public void setO5(UnknownPartitionException o5) { + this.o5 = o5; + } + + public void unsetO5() { + this.o5 = null; + } + + /** Returns true if field o5 is set (has been asigned a value) and false otherwise */ + public boolean isSetO5() { + return this.o5 != null; + } + + public void setO5IsSet(boolean value) { + if (!value) { + this.o5 = null; + } + } + + public InvalidPartitionException getO6() { + return this.o6; + } + + public void setO6(InvalidPartitionException o6) { + this.o6 = o6; + } + + public void unsetO6() { + this.o6 = null; + } + + /** Returns true if field o6 is set (has been asigned a value) and false otherwise */ + public boolean isSetO6() { + return this.o6 != null; + } + + public void setO6IsSet(boolean value) { + if (!value) { + this.o6 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((UnknownDBException)value); + } + break; + + case O4: + if (value == null) { + unsetO4(); + } else { + setO4((UnknownTableException)value); + } + break; + + case O5: + if (value == null) { + unsetO5(); + } else { + setO5((UnknownPartitionException)value); + } + break; + + case O6: + if (value == null) { + unsetO6(); + } else { + setO6((InvalidPartitionException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return new Boolean(isSuccess()); + + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + case O4: + return getO4(); + + case O5: + return getO5(); + + case O6: + return getO6(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + case O4: + return isSetO4(); + case O5: + return isSetO5(); + case O6: + return isSetO6(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof isPartitionMarkedForEvent_result) + return this.equals((isPartitionMarkedForEvent_result)that); + return false; + } + + public boolean equals(isPartitionMarkedForEvent_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + boolean this_present_o4 = true && this.isSetO4(); + boolean that_present_o4 = true && that.isSetO4(); + if (this_present_o4 || that_present_o4) { + if (!(this_present_o4 && that_present_o4)) + return false; + if (!this.o4.equals(that.o4)) + return false; + } + + boolean this_present_o5 = true && this.isSetO5(); + boolean that_present_o5 = true && that.isSetO5(); + if (this_present_o5 || that_present_o5) { + if (!(this_present_o5 && that_present_o5)) + return false; + if (!this.o5.equals(that.o5)) + return false; + } + + boolean this_present_o6 = true && this.isSetO6(); + boolean that_present_o6 = true && that.isSetO6(); + if (this_present_o6 || that_present_o6) { + if (!(this_present_o6 && that_present_o6)) + return false; + if (!this.o6.equals(that.o6)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(isPartitionMarkedForEvent_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + isPartitionMarkedForEvent_result typedOther = (isPartitionMarkedForEvent_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO2()).compareTo(typedOther.isSetO2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO2()) { + lastComparison = TBaseHelper.compareTo(this.o2, typedOther.o2); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO3()).compareTo(typedOther.isSetO3()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO3()) { + lastComparison = TBaseHelper.compareTo(this.o3, typedOther.o3); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO4()).compareTo(typedOther.isSetO4()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO4()) { + lastComparison = TBaseHelper.compareTo(this.o4, typedOther.o4); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO5()).compareTo(typedOther.isSetO5()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO5()) { + lastComparison = TBaseHelper.compareTo(this.o5, typedOther.o5); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO6()).compareTo(typedOther.isSetO6()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO6()) { + lastComparison = TBaseHelper.compareTo(this.o6, typedOther.o6); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // O1 + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // O2 + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // O3 + if (field.type == TType.STRUCT) { + this.o3 = new UnknownDBException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // O4 + if (field.type == TType.STRUCT) { + this.o4 = new UnknownTableException(); + this.o4.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // O5 + if (field.type == TType.STRUCT) { + this.o5 = new UnknownPartitionException(); + this.o5.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 6: // O6 + if (field.type == TType.STRUCT) { + this.o6 = new InvalidPartitionException(); + this.o6.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO4()) { + oprot.writeFieldBegin(O4_FIELD_DESC); + this.o4.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO5()) { + oprot.writeFieldBegin(O5_FIELD_DESC); + this.o5.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO6()) { + oprot.writeFieldBegin(O6_FIELD_DESC); + this.o6.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("isPartitionMarkedForEvent_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + if (!first) sb.append(", "); + sb.append("o4:"); + if (this.o4 == null) { + sb.append("null"); + } else { + sb.append(this.o4); + } + first = false; + if (!first) sb.append(", "); + sb.append("o5:"); + if (this.o5 == null) { + sb.append("null"); + } else { + sb.append(this.o5); + } + first = false; + if (!first) sb.append(", "); + sb.append("o6:"); + if (this.o6 == null) { + sb.append("null"); + } else { + sb.append(this.o6); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + public static class add_index_args implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("add_index_args"); @@ -45719,14 +48738,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list220 = iprot.readListBegin(); - this.success = new ArrayList(_list220.size); - for (int _i221 = 0; _i221 < _list220.size; ++_i221) + TList _list230 = iprot.readListBegin(); + this.success = new ArrayList(_list230.size); + for (int _i231 = 0; _i231 < _list230.size; ++_i231) { - Index _elem222; - _elem222 = new Index(); - _elem222.read(iprot); - this.success.add(_elem222); + Index _elem232; + _elem232 = new Index(); + _elem232.read(iprot); + this.success.add(_elem232); } iprot.readListEnd(); } @@ -45766,9 +48785,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Index _iter223 : this.success) + for (Index _iter233 : this.success) { - _iter223.write(oprot); + _iter233.write(oprot); } oprot.writeListEnd(); } @@ -46596,13 +49615,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list224 = iprot.readListBegin(); - this.success = new ArrayList(_list224.size); - for (int _i225 = 0; _i225 < _list224.size; ++_i225) + TList _list234 = iprot.readListBegin(); + this.success = new ArrayList(_list234.size); + for (int _i235 = 0; _i235 < _list234.size; ++_i235) { - String _elem226; - _elem226 = iprot.readString(); - this.success.add(_elem226); + String _elem236; + _elem236 = iprot.readString(); + this.success.add(_elem236); } iprot.readListEnd(); } @@ -46634,9 +49653,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter227 : this.success) + for (String _iter237 : this.success) { - oprot.writeString(_iter227); + oprot.writeString(_iter237); } oprot.writeListEnd(); } @@ -48469,13 +51488,13 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list228 = iprot.readListBegin(); - this.success = new ArrayList(_list228.size); - for (int _i229 = 0; _i229 < _list228.size; ++_i229) + TList _list238 = iprot.readListBegin(); + this.success = new ArrayList(_list238.size); + for (int _i239 = 0; _i239 < _list238.size; ++_i239) { - String _elem230; - _elem230 = iprot.readString(); - this.success.add(_elem230); + String _elem240; + _elem240 = iprot.readString(); + this.success.add(_elem240); } iprot.readListEnd(); } @@ -48507,9 +51526,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter231 : this.success) + for (String _iter241 : this.success) { - oprot.writeString(_iter231); + oprot.writeString(_iter241); } oprot.writeListEnd(); } @@ -51185,14 +54204,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list232 = iprot.readListBegin(); - this.success = new ArrayList(_list232.size); - for (int _i233 = 0; _i233 < _list232.size; ++_i233) + TList _list242 = iprot.readListBegin(); + this.success = new ArrayList(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) { - Role _elem234; - _elem234 = new Role(); - _elem234.read(iprot); - this.success.add(_elem234); + Role _elem244; + _elem244 = new Role(); + _elem244.read(iprot); + this.success.add(_elem244); } iprot.readListEnd(); } @@ -51224,9 +54243,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Role _iter235 : this.success) + for (Role _iter245 : this.success) { - _iter235.write(oprot); + _iter245.write(oprot); } oprot.writeListEnd(); } @@ -51671,13 +54690,13 @@ case 3: // GROUP_NAMES if (field.type == TType.LIST) { { - TList _list236 = iprot.readListBegin(); - this.group_names = new ArrayList(_list236.size); - for (int _i237 = 0; _i237 < _list236.size; ++_i237) + TList _list246 = iprot.readListBegin(); + this.group_names = new ArrayList(_list246.size); + for (int _i247 = 0; _i247 < _list246.size; ++_i247) { - String _elem238; - _elem238 = iprot.readString(); - this.group_names.add(_elem238); + String _elem248; + _elem248 = iprot.readString(); + this.group_names.add(_elem248); } iprot.readListEnd(); } @@ -51712,9 +54731,9 @@ oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); - for (String _iter239 : this.group_names) + for (String _iter249 : this.group_names) { - oprot.writeString(_iter239); + oprot.writeString(_iter249); } oprot.writeListEnd(); } @@ -52913,14 +55932,14 @@ case 0: // SUCCESS if (field.type == TType.LIST) { { - TList _list240 = iprot.readListBegin(); - this.success = new ArrayList(_list240.size); - for (int _i241 = 0; _i241 < _list240.size; ++_i241) + TList _list250 = iprot.readListBegin(); + this.success = new ArrayList(_list250.size); + for (int _i251 = 0; _i251 < _list250.size; ++_i251) { - HiveObjectPrivilege _elem242; - _elem242 = new HiveObjectPrivilege(); - _elem242.read(iprot); - this.success.add(_elem242); + HiveObjectPrivilege _elem252; + _elem252 = new HiveObjectPrivilege(); + _elem252.read(iprot); + this.success.add(_elem252); } iprot.readListEnd(); } @@ -52952,9 +55971,9 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (HiveObjectPrivilege _iter243 : this.success) + for (HiveObjectPrivilege _iter253 : this.success) { - _iter243.write(oprot); + _iter253.write(oprot); } oprot.writeListEnd(); } Index: metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/UnknownPartitionException.java =================================================================== --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/UnknownPartitionException.java (revision 0) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/UnknownPartitionException.java (revision 0) @@ -0,0 +1,306 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.*; +import org.apache.thrift.async.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.transport.*; +import org.apache.thrift.protocol.*; + +public class UnknownPartitionException extends Exception implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("UnknownPartitionException"); + + private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1); + + private String message; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + MESSAGE((short)1, "message"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(UnknownPartitionException.class, metaDataMap); + } + + public UnknownPartitionException() { + } + + public UnknownPartitionException( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public UnknownPartitionException(UnknownPartitionException other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public UnknownPartitionException deepCopy() { + return new UnknownPartitionException(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been asigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof UnknownPartitionException) + return this.equals((UnknownPartitionException)that); + return false; + } + + public boolean equals(UnknownPartitionException that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(UnknownPartitionException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + UnknownPartitionException typedOther = (UnknownPartitionException)other; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = TBaseHelper.compareTo(this.message, typedOther.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // MESSAGE + if (field.type == TType.STRING) { + this.message = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(this.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("UnknownPartitionException("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + Index: metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionEventType.java =================================================================== --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionEventType.java (revision 0) +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PartitionEventType.java (revision 0) @@ -0,0 +1,41 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum PartitionEventType implements TEnum { + LOAD_DONE(1); + + private final int value; + + private PartitionEventType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static PartitionEventType findByValue(int value) { + switch (value) { + case 1: + return LOAD_DONE; + default: + return null; + } + } +} Index: metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php =================================================================== --- metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php (revision 1136105) +++ metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php (working copy) @@ -49,6 +49,8 @@ public function get_config_value($name, $defaultValue); public function partition_name_to_vals($part_name); public function partition_name_to_spec($part_name); + public function markPartitionForEvent($db_name, $tbl_name, $part_vals, $eventType); + public function isPartitionMarkedForEvent($db_name, $tbl_name, $part_vals, $eventType); public function add_index($new_index, $index_table); public function alter_index($dbname, $base_tbl_name, $idx_name, $new_idx); public function drop_index_by_name($db_name, $tbl_name, $index_name, $deleteData); @@ -2333,6 +2335,147 @@ throw new Exception("partition_name_to_spec failed: unknown result"); } + public function markPartitionForEvent($db_name, $tbl_name, $part_vals, $eventType) + { + $this->send_markPartitionForEvent($db_name, $tbl_name, $part_vals, $eventType); + $this->recv_markPartitionForEvent(); + } + + public function send_markPartitionForEvent($db_name, $tbl_name, $part_vals, $eventType) + { + $args = new metastore_ThriftHiveMetastore_markPartitionForEvent_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $args->eventType = $eventType; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'markPartitionForEvent', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('markPartitionForEvent', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_markPartitionForEvent() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_markPartitionForEvent_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_markPartitionForEvent_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + if ($result->o4 !== null) { + throw $result->o4; + } + if ($result->o5 !== null) { + throw $result->o5; + } + if ($result->o6 !== null) { + throw $result->o6; + } + return; + } + + public function isPartitionMarkedForEvent($db_name, $tbl_name, $part_vals, $eventType) + { + $this->send_isPartitionMarkedForEvent($db_name, $tbl_name, $part_vals, $eventType); + return $this->recv_isPartitionMarkedForEvent(); + } + + public function send_isPartitionMarkedForEvent($db_name, $tbl_name, $part_vals, $eventType) + { + $args = new metastore_ThriftHiveMetastore_isPartitionMarkedForEvent_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->part_vals = $part_vals; + $args->eventType = $eventType; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'isPartitionMarkedForEvent', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('isPartitionMarkedForEvent', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_isPartitionMarkedForEvent() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_isPartitionMarkedForEvent_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_isPartitionMarkedForEvent_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + if ($result->o3 !== null) { + throw $result->o3; + } + if ($result->o4 !== null) { + throw $result->o4; + } + if ($result->o5 !== null) { + throw $result->o5; + } + if ($result->o6 !== null) { + throw $result->o6; + } + throw new Exception("isPartitionMarkedForEvent failed: unknown result"); + } + public function add_index($new_index, $index_table) { $this->send_add_index($new_index, $index_table); @@ -12606,6 +12749,726 @@ } +class metastore_ThriftHiveMetastore_markPartitionForEvent_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + public $eventType = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'eventType', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['eventType'])) { + $this->eventType = $vals['eventType']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_markPartitionForEvent_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::MAP) { + $this->part_vals = array(); + $_size388 = 0; + $_ktype389 = 0; + $_vtype390 = 0; + $xfer += $input->readMapBegin($_ktype389, $_vtype390, $_size388); + for ($_i392 = 0; $_i392 < $_size388; ++$_i392) + { + $key393 = ''; + $val394 = ''; + $xfer += $input->readString($key393); + $xfer += $input->readString($val394); + $this->part_vals[$key393] = $val394; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->eventType); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_markPartitionForEvent_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::MAP, 3); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $kiter395 => $viter396) + { + $xfer += $output->writeString($kiter395); + $xfer += $output->writeString($viter396); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->eventType !== null) { + $xfer += $output->writeFieldBegin('eventType', TType::I32, 4); + $xfer += $output->writeI32($this->eventType); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_markPartitionForEvent_result { + static $_TSPEC; + + public $o1 = null; + public $o2 = null; + public $o3 = null; + public $o4 = null; + public $o5 = null; + public $o6 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownDBException', + ), + 4 => array( + 'var' => 'o4', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownTableException', + ), + 5 => array( + 'var' => 'o5', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownPartitionException', + ), + 6 => array( + 'var' => 'o6', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidPartitionException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + if (isset($vals['o4'])) { + $this->o4 = $vals['o4']; + } + if (isset($vals['o5'])) { + $this->o5 = $vals['o5']; + } + if (isset($vals['o6'])) { + $this->o6 = $vals['o6']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_markPartitionForEvent_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_UnknownDBException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->o4 = new metastore_UnknownTableException(); + $xfer += $this->o4->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::STRUCT) { + $this->o5 = new metastore_UnknownPartitionException(); + $xfer += $this->o5->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRUCT) { + $this->o6 = new metastore_InvalidPartitionException(); + $xfer += $this->o6->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_markPartitionForEvent_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o3 !== null) { + $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3); + $xfer += $this->o3->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o4 !== null) { + $xfer += $output->writeFieldBegin('o4', TType::STRUCT, 4); + $xfer += $this->o4->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o5 !== null) { + $xfer += $output->writeFieldBegin('o5', TType::STRUCT, 5); + $xfer += $this->o5->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o6 !== null) { + $xfer += $output->writeFieldBegin('o6', TType::STRUCT, 6); + $xfer += $this->o6->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_isPartitionMarkedForEvent_args { + static $_TSPEC; + + public $db_name = null; + public $tbl_name = null; + public $part_vals = null; + public $eventType = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'part_vals', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + 4 => array( + 'var' => 'eventType', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['part_vals'])) { + $this->part_vals = $vals['part_vals']; + } + if (isset($vals['eventType'])) { + $this->eventType = $vals['eventType']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_isPartitionMarkedForEvent_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::MAP) { + $this->part_vals = array(); + $_size397 = 0; + $_ktype398 = 0; + $_vtype399 = 0; + $xfer += $input->readMapBegin($_ktype398, $_vtype399, $_size397); + for ($_i401 = 0; $_i401 < $_size397; ++$_i401) + { + $key402 = ''; + $val403 = ''; + $xfer += $input->readString($key402); + $xfer += $input->readString($val403); + $this->part_vals[$key402] = $val403; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->eventType); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_isPartitionMarkedForEvent_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->part_vals !== null) { + if (!is_array($this->part_vals)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('part_vals', TType::MAP, 3); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->part_vals)); + { + foreach ($this->part_vals as $kiter404 => $viter405) + { + $xfer += $output->writeString($kiter404); + $xfer += $output->writeString($viter405); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->eventType !== null) { + $xfer += $output->writeFieldBegin('eventType', TType::I32, 4); + $xfer += $output->writeI32($this->eventType); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_isPartitionMarkedForEvent_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + public $o2 = null; + public $o3 = null; + public $o4 = null; + public $o5 = null; + public $o6 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => 'metastore_NoSuchObjectException', + ), + 3 => array( + 'var' => 'o3', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownDBException', + ), + 4 => array( + 'var' => 'o4', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownTableException', + ), + 5 => array( + 'var' => 'o5', + 'type' => TType::STRUCT, + 'class' => 'metastore_UnknownPartitionException', + ), + 6 => array( + 'var' => 'o6', + 'type' => TType::STRUCT, + 'class' => 'metastore_InvalidPartitionException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + if (isset($vals['o3'])) { + $this->o3 = $vals['o3']; + } + if (isset($vals['o4'])) { + $this->o4 = $vals['o4']; + } + if (isset($vals['o5'])) { + $this->o5 = $vals['o5']; + } + if (isset($vals['o6'])) { + $this->o6 = $vals['o6']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_isPartitionMarkedForEvent_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new metastore_NoSuchObjectException(); + $xfer += $this->o2->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->o3 = new metastore_UnknownDBException(); + $xfer += $this->o3->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->o4 = new metastore_UnknownTableException(); + $xfer += $this->o4->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::STRUCT) { + $this->o5 = new metastore_UnknownPartitionException(); + $xfer += $this->o5->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRUCT) { + $this->o6 = new metastore_InvalidPartitionException(); + $xfer += $this->o6->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_isPartitionMarkedForEvent_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o3 !== null) { + $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3); + $xfer += $this->o3->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o4 !== null) { + $xfer += $output->writeFieldBegin('o4', TType::STRUCT, 4); + $xfer += $this->o4->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o5 !== null) { + $xfer += $output->writeFieldBegin('o5', TType::STRUCT, 5); + $xfer += $this->o5->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o6 !== null) { + $xfer += $output->writeFieldBegin('o6', TType::STRUCT, 6); + $xfer += $this->o6->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class metastore_ThriftHiveMetastore_add_index_args { static $_TSPEC; @@ -13743,15 +14606,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size388 = 0; - $_etype391 = 0; - $xfer += $input->readListBegin($_etype391, $_size388); - for ($_i392 = 0; $_i392 < $_size388; ++$_i392) + $_size406 = 0; + $_etype409 = 0; + $xfer += $input->readListBegin($_etype409, $_size406); + for ($_i410 = 0; $_i410 < $_size406; ++$_i410) { - $elem393 = null; - $elem393 = new metastore_Index(); - $xfer += $elem393->read($input); - $this->success []= $elem393; + $elem411 = null; + $elem411 = new metastore_Index(); + $xfer += $elem411->read($input); + $this->success []= $elem411; } $xfer += $input->readListEnd(); } else { @@ -13795,9 +14658,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter394) + foreach ($this->success as $iter412) { - $xfer += $iter394->write($output); + $xfer += $iter412->write($output); } } $output->writeListEnd(); @@ -13989,14 +14852,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size395 = 0; - $_etype398 = 0; - $xfer += $input->readListBegin($_etype398, $_size395); - for ($_i399 = 0; $_i399 < $_size395; ++$_i399) + $_size413 = 0; + $_etype416 = 0; + $xfer += $input->readListBegin($_etype416, $_size413); + for ($_i417 = 0; $_i417 < $_size413; ++$_i417) { - $elem400 = null; - $xfer += $input->readString($elem400); - $this->success []= $elem400; + $elem418 = null; + $xfer += $input->readString($elem418); + $this->success []= $elem418; } $xfer += $input->readListEnd(); } else { @@ -14032,9 +14895,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter401) + foreach ($this->success as $iter419) { - $xfer += $output->writeString($iter401); + $xfer += $output->writeString($iter419); } } $output->writeListEnd(); @@ -14496,14 +15359,14 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size402 = 0; - $_etype405 = 0; - $xfer += $input->readListBegin($_etype405, $_size402); - for ($_i406 = 0; $_i406 < $_size402; ++$_i406) + $_size420 = 0; + $_etype423 = 0; + $xfer += $input->readListBegin($_etype423, $_size420); + for ($_i424 = 0; $_i424 < $_size420; ++$_i424) { - $elem407 = null; - $xfer += $input->readString($elem407); - $this->success []= $elem407; + $elem425 = null; + $xfer += $input->readString($elem425); + $this->success []= $elem425; } $xfer += $input->readListEnd(); } else { @@ -14539,9 +15402,9 @@ { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter408) + foreach ($this->success as $iter426) { - $xfer += $output->writeString($iter408); + $xfer += $output->writeString($iter426); } } $output->writeListEnd(); @@ -15181,15 +16044,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size409 = 0; - $_etype412 = 0; - $xfer += $input->readListBegin($_etype412, $_size409); - for ($_i413 = 0; $_i413 < $_size409; ++$_i413) + $_size427 = 0; + $_etype430 = 0; + $xfer += $input->readListBegin($_etype430, $_size427); + for ($_i431 = 0; $_i431 < $_size427; ++$_i431) { - $elem414 = null; - $elem414 = new metastore_Role(); - $xfer += $elem414->read($input); - $this->success []= $elem414; + $elem432 = null; + $elem432 = new metastore_Role(); + $xfer += $elem432->read($input); + $this->success []= $elem432; } $xfer += $input->readListEnd(); } else { @@ -15225,9 +16088,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter415) + foreach ($this->success as $iter433) { - $xfer += $iter415->write($output); + $xfer += $iter433->write($output); } } $output->writeListEnd(); @@ -15325,14 +16188,14 @@ case 3: if ($ftype == TType::LST) { $this->group_names = array(); - $_size416 = 0; - $_etype419 = 0; - $xfer += $input->readListBegin($_etype419, $_size416); - for ($_i420 = 0; $_i420 < $_size416; ++$_i420) + $_size434 = 0; + $_etype437 = 0; + $xfer += $input->readListBegin($_etype437, $_size434); + for ($_i438 = 0; $_i438 < $_size434; ++$_i438) { - $elem421 = null; - $xfer += $input->readString($elem421); - $this->group_names []= $elem421; + $elem439 = null; + $xfer += $input->readString($elem439); + $this->group_names []= $elem439; } $xfer += $input->readListEnd(); } else { @@ -15373,9 +16236,9 @@ { $output->writeListBegin(TType::STRING, count($this->group_names)); { - foreach ($this->group_names as $iter422) + foreach ($this->group_names as $iter440) { - $xfer += $output->writeString($iter422); + $xfer += $output->writeString($iter440); } } $output->writeListEnd(); @@ -15662,15 +16525,15 @@ case 0: if ($ftype == TType::LST) { $this->success = array(); - $_size423 = 0; - $_etype426 = 0; - $xfer += $input->readListBegin($_etype426, $_size423); - for ($_i427 = 0; $_i427 < $_size423; ++$_i427) + $_size441 = 0; + $_etype444 = 0; + $xfer += $input->readListBegin($_etype444, $_size441); + for ($_i445 = 0; $_i445 < $_size441; ++$_i445) { - $elem428 = null; - $elem428 = new metastore_HiveObjectPrivilege(); - $xfer += $elem428->read($input); - $this->success []= $elem428; + $elem446 = null; + $elem446 = new metastore_HiveObjectPrivilege(); + $xfer += $elem446->read($input); + $this->success []= $elem446; } $xfer += $input->readListEnd(); } else { @@ -15706,9 +16569,9 @@ { $output->writeListBegin(TType::STRUCT, count($this->success)); { - foreach ($this->success as $iter429) + foreach ($this->success as $iter447) { - $xfer += $iter429->write($output); + $xfer += $iter447->write($output); } } $output->writeListEnd(); Index: metastore/src/gen/thrift/gen-php/hive_metastore/hive_metastore_types.php =================================================================== --- metastore/src/gen/thrift/gen-php/hive_metastore/hive_metastore_types.php (revision 1136105) +++ metastore/src/gen/thrift/gen-php/hive_metastore/hive_metastore_types.php (working copy) @@ -48,6 +48,17 @@ ); } +$GLOBALS['metastore_E_PartitionEventType'] = array( + 'LOAD_DONE' => 1, +); + +final class metastore_PartitionEventType { + const LOAD_DONE = 1; + static public $__names = array( + 1 => 'LOAD_DONE', + ); +} + class metastore_Version { static $_TSPEC; @@ -3586,6 +3597,150 @@ } +class metastore_InvalidPartitionException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'InvalidPartitionException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('InvalidPartitionException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_UnknownPartitionException extends TException { + static $_TSPEC; + + public $message = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + } + } + + public function getName() { + return 'UnknownPartitionException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('UnknownPartitionException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class metastore_InvalidObjectException extends TException { static $_TSPEC; Index: metastore/if/hive_metastore.thrift =================================================================== --- metastore/if/hive_metastore.thrift (revision 1136105) +++ metastore/if/hive_metastore.thrift (working copy) @@ -43,6 +43,10 @@ GROUP = 3, } +enum PartitionEventType { + LOAD_DONE = 1, +} + struct HiveObjectRef{ 1: HiveObjectType objectType, 2: string dbName, @@ -182,6 +186,14 @@ 1: string message } +exception InvalidPartitionException { + 1: string message +} + +exception UnknownPartitionException { + 1: string message +} + exception InvalidObjectException { 1: string message } @@ -331,6 +343,15 @@ map partition_name_to_spec(1: string part_name) throws(1: MetaException o1) + void markPartitionForEvent(1:string db_name, 2:string tbl_name, 3:map part_vals, + 4:PartitionEventType eventType) throws (1: MetaException o1, 2: NoSuchObjectException o2, + 3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5, + 6: InvalidPartitionException o6) + bool isPartitionMarkedForEvent(1:string db_name, 2:string tbl_name, 3:map part_vals, + 4: PartitionEventType eventType) throws (1: MetaException o1, 2:NoSuchObjectException o2, + 3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5, + 6: InvalidPartitionException o6) + //index Index add_index(1:Index new_index, 2: Table index_table) throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)