diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java index 23a1b97..5998bec 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java @@ -47,6 +47,7 @@ import java.util.Set; import java.util.regex.Pattern; +import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.Path; @@ -2296,4 +2297,42 @@ private void verifyFetchedLog(List logs, String[] expectedLogs) { assertTrue(accumulatedLogs.contains(expectedLog)); } } + + @Test + public void testCompileAndRun() throws Exception { + HiveStatement statement = (HiveStatement) con.createStatement(); + + Assert.assertFalse(statement.compile("set navis=manse")); + + Assert.assertTrue(statement.compile("select * from " + dataTypeTableName + " where c1 is not null order by c1 limit 10")); + Assert.assertTrue(statement.getQueryPlan() != null); + + statement.executeTransient("set navis=manse"); + + statement.run(); + + ResultSet result = statement.getResultSet(); + + String result1 = "-1 false -1.1 [] {} {} {\"r\":null,\"s\":null,\"t\":null} -1 -1 -1.0 -1 [] {} {\"r\":null,\"s\":null} [] null null null null null null null 20090619"; + String result2 = "1 true 1.1 1 [1,2] {1:\"x\",2:\"y\"} {\"k\":\"v\"} {\"r\":\"a\",\"s\":9,\"t\":2.2} 1 1 1.0 1 [[\"a\",\"b\"],[\"c\",\"d\"]] {1:{11:12,13:14},2:{21:22}} {\"r\":1,\"s\":{\"a\":2,\"b\":\"x\"}} [{\"m\":{},\"n\":1},{\"m\":{\"a\":\"b\",\"c\":\"d\"},\"n\":2}] 2012-04-22 09:00:00.123456789 123456789.0123456 abcd 2013-01-01 abc123 abc123 X'01FF' 20090619"; + ResultSetMetaData metaData = result.getMetaData(); + Assert.assertTrue(result.next()); + Assert.assertEquals(result1, getRowString(result, metaData)); + Assert.assertTrue(result.next()); + Assert.assertEquals(result2, getRowString(result, metaData)); + Assert.assertFalse(result.next()); + statement.close(); + } + + private String getRowString(ResultSet result, ResultSetMetaData metaData) + throws SQLException { + StringBuilder builder = new StringBuilder(); + for (int i = 1; i <= metaData.getColumnCount(); i++) { + if (i > 1) { + builder.append(' '); + } + builder.append(result.getString(i)); + } + return builder.toString(); + } } diff --git jdbc/pom.xml jdbc/pom.xml index 6385093..f9f8138 100644 --- jdbc/pom.xml +++ jdbc/pom.xml @@ -63,6 +63,11 @@ org.apache.hive + hive-exec + ${project.version} + + + org.apache.hive hive-shims ${project.version} diff --git jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java index d8e33d3..5ca9f4d 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java @@ -29,6 +29,7 @@ import java.util.Map; import java.util.concurrent.locks.ReentrantLock; +import org.apache.hadoop.hive.ql.plan.api.Query; import org.apache.hive.service.cli.RowSet; import org.apache.hive.service.cli.RowSetFactory; import org.apache.hive.service.cli.thrift.TCLIService; @@ -36,15 +37,18 @@ import org.apache.hive.service.cli.thrift.TCancelOperationResp; import org.apache.hive.service.cli.thrift.TCloseOperationReq; import org.apache.hive.service.cli.thrift.TCloseOperationResp; +import org.apache.hive.service.cli.thrift.TCompileRes; import org.apache.hive.service.cli.thrift.TExecuteStatementReq; import org.apache.hive.service.cli.thrift.TExecuteStatementResp; import org.apache.hive.service.cli.thrift.TGetOperationStatusReq; import org.apache.hive.service.cli.thrift.TGetOperationStatusResp; import org.apache.hive.service.cli.thrift.TOperationHandle; +import org.apache.hive.service.cli.thrift.TRunReq; import org.apache.hive.service.cli.thrift.TSessionHandle; import org.apache.hive.service.cli.thrift.TFetchResultsReq; import org.apache.hive.service.cli.thrift.TFetchResultsResp; import org.apache.hive.service.cli.thrift.TFetchOrientation; +import org.apache.hive.service.cli.thrift.TStatus; /** * HiveStatement. @@ -53,7 +57,8 @@ public class HiveStatement implements java.sql.Statement { private final HiveConnection connection; private TCLIService.Iface client; - private TOperationHandle stmtHandle = null; + private TOperationHandle stmtHandle; + private Query queryPlan; private final TSessionHandle sessHandle; Map sessConf = new HashMap(); private int fetchSize = 50; @@ -202,6 +207,7 @@ void closeClientOperation() throws SQLException { isQueryClosed = true; isExecuteStatementFailed = false; stmtHandle = null; + queryPlan = null; } /* @@ -225,6 +231,86 @@ public void closeOnCompletion() throws SQLException { throw new SQLException("Method not supported"); } + public boolean compile(String sql) throws SQLException { + if (isClosed) { + throw new SQLException("Can't compile after statement has been closed"); + } + if (stmtHandle != null) { + closeClientOperation(); + } + TExecuteStatementReq compileReq = new TExecuteStatementReq(sessHandle, sql); + + transportLock.lock(); + try { + TCompileRes compileRes = client.Compile(compileReq); + Utils.verifySuccessWithInfo(compileRes.getStatus()); + stmtHandle = compileRes.getOperationHandle(); + queryPlan = compileRes.getQueryPlan(); + } catch (SQLException eS) { + throw eS; + } catch (Exception ex) { + throw new SQLException(ex.toString(), "08S01", ex); + } finally { + transportLock.unlock(); + } + if (!stmtHandle.isHasResultSet()) { + return false; + } + resultSet = new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle) + .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize) + .setScrollable(isScrollableResultset) + .build(); + return true; + } + + public void executeTransient(String sql) throws SQLException { + if (isClosed) { + throw new SQLException("Can't execute after statement has been closed"); + } + TExecuteStatementReq execReq = new TExecuteStatementReq(sessHandle, sql); + + transportLock.lock(); + try { + TStatus status = client.ExecuteTransient(execReq); + Utils.verifySuccessWithInfo(status); + } catch (SQLException eS) { + throw eS; + } catch (Exception ex) { + throw new SQLException(ex.toString(), "08S01", ex); + } finally { + transportLock.unlock(); + } + } + + public boolean run() throws SQLException { + if (isClosed) { + throw new SQLException("Can't run after statement has been closed"); + } + if (stmtHandle == null) { + throw new SQLException("Operation is not compiled"); + } + TRunReq runReq = new TRunReq(sessHandle, stmtHandle); + transportLock.lock(); + try { + TStatus runRes = client.Run(runReq); + Utils.verifySuccessWithInfo(runRes); + } catch (SQLException eS) { + throw eS; + } catch (Exception ex) { + throw new SQLException(ex.toString(), "08S01", ex); + } finally { + transportLock.unlock(); + } + return stmtHandle.isHasResultSet(); + } + + public Query getQueryPlan() throws SQLException { + if (isClosed) { + throw new SQLException("Can't get query plan after statement has been closed"); + } + return queryPlan; + } + /* * (non-Javadoc) * diff --git ql/src/java/org/apache/hadoop/hive/ql/Driver.java ql/src/java/org/apache/hadoop/hive/ql/Driver.java index 395a5f5..a92d30c 100644 --- ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -114,7 +114,6 @@ import org.apache.hadoop.hive.ql.session.SessionState; import org.apache.hadoop.hive.ql.session.SessionState.LogHelper; import org.apache.hadoop.hive.serde2.ByteStream; -import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hadoop.hive.shims.Utils; import org.apache.hadoop.mapred.ClusterStatus; import org.apache.hadoop.mapred.JobClient; @@ -152,9 +151,8 @@ private String userName; - private boolean checkConcurrency() throws SemanticException { - boolean supportConcurrency = conf.getBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY); - if (!supportConcurrency) { + private boolean checkConcurrency() { + if (!conf.getBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY)) { LOG.info("Concurrency mode is disabled, not creating a lock manager"); return false; } @@ -435,8 +433,9 @@ public int compile(String command, boolean resetTaskIds) { sem.validate(); perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.ANALYZE); - plan = new QueryPlan(command, sem, perfLogger.getStartTime(PerfLogger.DRIVER_RUN), queryId, - SessionState.get().getCommandType()); + plan = new QueryPlan(command, sem, + perfLogger.getStartTime(PerfLogger.DRIVER_COMPILE), queryId, + SessionState.get().getCommandType()); String queryStr = plan.getQueryStr(); conf.setVar(HiveConf.ConfVars.HIVEQUERYSTRING, queryStr); @@ -1032,17 +1031,7 @@ private void releaseLocksAndCommitOrRollback(List hiveLocks, boolean c @Override public CommandProcessorResponse run(String command) throws CommandNeedRetryException { - return run(command, false); - } - - public CommandProcessorResponse run() - throws CommandNeedRetryException { - return run(null, true); - } - - public CommandProcessorResponse run(String command, boolean alreadyCompiled) - throws CommandNeedRetryException { - CommandProcessorResponse cpr = runInternal(command, alreadyCompiled); + CommandProcessorResponse cpr = compileAndRun(command); if(cpr.getResponseCode() == 0) { return cpr; } @@ -1098,28 +1087,15 @@ public CommandProcessorResponse run(String command, boolean alreadyCompiled) return cpr; } - public CommandProcessorResponse compileAndRespond(String command) { - return createProcessorResponse(compileInternal(command)); - } - - private int compileInternal(String command) { - int ret; - synchronized (compileMonitor) { - ret = compile(command); - } - if (ret != 0) { - try { - releaseLocksAndCommitOrRollback(ctx.getHiveLocks(), false); - } catch (LockException e) { - LOG.warn("Exception in releasing locks. " - + org.apache.hadoop.util.StringUtils.stringifyException(e)); - } + private CommandProcessorResponse compileAndRun(String command) throws CommandNeedRetryException { + CommandProcessorResponse ret = compileAndRespond(command); + if (ret.getResponseCode() == 0) { + return executePlan(); } return ret; } - private CommandProcessorResponse runInternal(String command, boolean alreadyCompiled) - throws CommandNeedRetryException { + public CommandProcessorResponse compileAndRespond(String command) { errorMessage = null; SQLState = null; downstreamError = null; @@ -1129,13 +1105,14 @@ private CommandProcessorResponse runInternal(String command, boolean alreadyComp } HiveDriverRunHookContext hookContext = new HiveDriverRunHookContextImpl(conf, command); + SessionState.get().setHookContext(hookContext); // Get all the driver run hooks and pre-execute them. List driverRunHooks; try { driverRunHooks = getHooks(HiveConf.ConfVars.HIVE_DRIVER_RUN_HOOKS, HiveDriverRunHook.class); for (HiveDriverRunHook driverRunHook : driverRunHooks) { - driverRunHook.preDriverRun(hookContext); + driverRunHook.preDriverRun(hookContext); } } catch (Exception e) { errorMessage = "FAILED: Hive Internal Error: " + Utilities.getNameMessage(e); @@ -1149,36 +1126,39 @@ private CommandProcessorResponse runInternal(String command, boolean alreadyComp // Reset the perf logger PerfLogger perfLogger = PerfLogger.getPerfLogger(true); perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.DRIVER_RUN); + perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.DRIVER_COMPILE); perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TIME_TO_SUBMIT); - boolean requireLock = false; - boolean ckLock = false; - SessionState ss = SessionState.get(); - try { - ckLock = checkConcurrency(); - } catch (SemanticException e) { - errorMessage = "FAILED: Error in semantic analysis: " + e.getMessage(); - SQLState = ErrorMsg.findSQLState(e.getMessage()); - downstreamError = e; - console.printError(errorMessage, "\n" - + org.apache.hadoop.util.StringUtils.stringifyException(e)); - return createProcessorResponse(10); - } - int ret; - if (!alreadyCompiled) { - ret = compileInternal(command); - if (ret != 0) { - return createProcessorResponse(ret); + synchronized (compileMonitor) { + ret = compile(command); + } + if (ret != 0) { + try { + releaseLocksAndCommitOrRollback(ctx.getHiveLocks(), false); + } catch (LockException e) { + LOG.warn("Exception in releasing locks. " + + org.apache.hadoop.util.StringUtils.stringifyException(e)); } } + perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.DRIVER_COMPILE); + + return new CommandProcessorResponse(ret, errorMessage, SQLState); + } + + public CommandProcessorResponse executePlan() throws CommandNeedRetryException { + + SessionState ss = SessionState.get(); // the reason that we set the txn manager for the cxt here is because each // query has its own ctx object. The txn mgr is shared across the // same instance of Driver, which can run multiple queries. ctx.setHiveTxnManager(ss.getTxnMgr()); - if (ckLock) { + int ret; + boolean requireLock = false; + + if (checkConcurrency()) { boolean lockOnlyMapred = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_LOCK_MAPRED_ONLY); if(lockOnlyMapred) { Queue> taskQueue = new LinkedList>(); @@ -1238,13 +1218,17 @@ private CommandProcessorResponse runInternal(String command, boolean alreadyComp return createProcessorResponse(12); } + PerfLogger perfLogger = PerfLogger.getPerfLogger(true); perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.DRIVER_RUN); perfLogger.close(LOG, plan); // Take all the driver run hooks and post-execute them. + HiveDriverRunHookContext hookContext = SessionState.get().getHookContext(); + List driverRunHooks; try { + driverRunHooks = getHooks(HiveConf.ConfVars.HIVE_DRIVER_RUN_HOOKS, HiveDriverRunHook.class); for (HiveDriverRunHook driverRunHook : driverRunHooks) { - driverRunHook.postDriverRun(hookContext); + driverRunHook.postDriverRun(hookContext); } } catch (Exception e) { errorMessage = "FAILED: Hive Internal Error: " + Utilities.getNameMessage(e); diff --git ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java index 8e1e6e2..29acc98 100644 --- ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java +++ ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java @@ -211,7 +211,7 @@ private void populateOperatorGraph( * * @throws IOException */ - private void populateQueryPlan() throws IOException { + private void populateQueryPlan() { query.setStageGraph(new org.apache.hadoop.hive.ql.plan.api.Graph()); query.getStageGraph().setNodeType(NodeType.STAGE); @@ -349,7 +349,7 @@ private void updateCountersInQueryPlan() { /** * Extract all the counters from tasks and operators. */ - private void extractCounters() throws IOException { + private void extractCounters() { Queue> tasksToVisit = new LinkedList>(); Set> tasksVisited = @@ -410,8 +410,7 @@ private void extractCounters() throws IOException { } } - public org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan() - throws IOException { + public org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan() { if (query.getStageGraph() == null) { populateQueryPlan(); } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java index 4170659..b6e8dec 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java @@ -436,24 +436,21 @@ private static BaseWork getBaseWork(Configuration conf, String name) { } public static void setWorkflowAdjacencies(Configuration conf, QueryPlan plan) { - try { - Graph stageGraph = plan.getQueryPlan().getStageGraph(); - if (stageGraph == null) { - return; - } - List adjList = stageGraph.getAdjacencyList(); - if (adjList == null) { + Graph stageGraph = plan.getQueryPlan().getStageGraph(); + if (stageGraph == null) { + return; + } + List adjList = stageGraph.getAdjacencyList(); + if (adjList == null) { + return; + } + for (Adjacency adj : adjList) { + List children = adj.getChildren(); + if (children == null || children.isEmpty()) { return; } - for (Adjacency adj : adjList) { - List children = adj.getChildren(); - if (children == null || children.isEmpty()) { - return; - } - conf.setStrings("mapreduce.workflow.adjacency."+adj.getNode(), - children.toArray(new String[children.size()])); - } - } catch (IOException e) { + conf.setStrings("mapreduce.workflow.adjacency."+adj.getNode(), + children.toArray(new String[children.size()])); } } diff --git ql/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java ql/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java index 4e2b130..15c197e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java +++ ql/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java @@ -51,6 +51,7 @@ public static final String PRE_HOOK = "PreHook."; public static final String POST_HOOK = "PostHook."; public static final String FAILURE_HOOK = "FailureHook."; + public static final String DRIVER_COMPILE = "Driver.compile"; public static final String DRIVER_RUN = "Driver.run"; public static final String TIME_TO_SUBMIT = "TimeToSubmit"; public static final String TEZ_SUBMIT_TO_RUNNING = "TezSubmitToRunningDag"; diff --git ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java index 1b5864e..1c5c1f3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java +++ ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj; +import org.apache.hadoop.hive.ql.HiveDriverRunHookContext; import org.apache.hadoop.hive.ql.MapRedStats; import org.apache.hadoop.hive.ql.exec.Utilities; import org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager; @@ -64,7 +65,6 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzSessionContext.CLIENT_TYPE; import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveMetastoreClientFactoryImpl; import org.apache.hadoop.hive.ql.util.DosToUnix; -import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hadoop.hive.shims.Utils; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.util.ReflectionUtils; @@ -184,6 +184,8 @@ */ LineageState ls; + private transient HiveDriverRunHookContext hookContext; + private PerfLogger perfLogger; private final String userName; @@ -748,6 +750,14 @@ public void setLastCommand(String lastCommand) { this.lastCommand = lastCommand; } + public void setHookContext(HiveDriverRunHookContext hookContext) { + this.hookContext = hookContext; + } + + public HiveDriverRunHookContext getHookContext() { + return hookContext; + } + /** * This class provides helper routines to emit informational and error * messages to the user and log4j files while obeying the current session's diff --git service/if/TCLIService.thrift service/if/TCLIService.thrift index 4024bb3..0eaf1ab 100644 --- service/if/TCLIService.thrift +++ service/if/TCLIService.thrift @@ -35,6 +35,8 @@ namespace java org.apache.hive.service.cli.thrift namespace cpp apache.hive.service.cli.thrift +include "ql/if/queryplan.thrift" + // List of protocol versions. A new token should be // added to the end of this list every time a change is made. enum TProtocolVersion { @@ -1123,6 +1125,17 @@ struct TRenewDelegationTokenResp { 1: required TStatus status } +struct TCompileRes { + 1: required TStatus status + 2: required TOperationHandle operationHandle + 3: optional queryplan.Query queryPlan +} + +struct TRunReq { + 1: required TSessionHandle sessionHandle + 2: required TOperationHandle operationHandle +} + service TCLIService { TOpenSessionResp OpenSession(1:TOpenSessionReq req); @@ -1133,6 +1146,12 @@ service TCLIService { TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req); + TCompileRes Compile(1:TExecuteStatementReq req); + + TStatus Run(1:TRunReq req); + + TStatus ExecuteTransient(1:TExecuteStatementReq req); + TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req); TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req); diff --git service/src/gen/thrift/gen-cpp/TCLIService.cpp service/src/gen/thrift/gen-cpp/TCLIService.cpp index 209ce63..919fdef 100644 --- service/src/gen/thrift/gen-cpp/TCLIService.cpp +++ service/src/gen/thrift/gen-cpp/TCLIService.cpp @@ -656,7 +656,7 @@ uint32_t TCLIService_ExecuteStatement_presult::read(::apache::thrift::protocol:: return xfer; } -uint32_t TCLIService_GetTypeInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Compile_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -696,9 +696,9 @@ uint32_t TCLIService_GetTypeInfo_args::read(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetTypeInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Compile_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_args"); + xfer += oprot->writeStructBegin("TCLIService_Compile_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -709,9 +709,9 @@ uint32_t TCLIService_GetTypeInfo_args::write(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetTypeInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Compile_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_pargs"); + xfer += oprot->writeStructBegin("TCLIService_Compile_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -722,7 +722,7 @@ uint32_t TCLIService_GetTypeInfo_pargs::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetTypeInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Compile_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -762,11 +762,11 @@ uint32_t TCLIService_GetTypeInfo_result::read(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetTypeInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Compile_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_result"); + xfer += oprot->writeStructBegin("TCLIService_Compile_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -778,7 +778,7 @@ uint32_t TCLIService_GetTypeInfo_result::write(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetTypeInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Compile_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -818,7 +818,7 @@ uint32_t TCLIService_GetTypeInfo_presult::read(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetCatalogs_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Run_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -858,9 +858,9 @@ uint32_t TCLIService_GetCatalogs_args::read(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetCatalogs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Run_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_args"); + xfer += oprot->writeStructBegin("TCLIService_Run_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -871,9 +871,9 @@ uint32_t TCLIService_GetCatalogs_args::write(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetCatalogs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Run_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_pargs"); + xfer += oprot->writeStructBegin("TCLIService_Run_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -884,7 +884,7 @@ uint32_t TCLIService_GetCatalogs_pargs::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetCatalogs_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Run_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -924,11 +924,11 @@ uint32_t TCLIService_GetCatalogs_result::read(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetCatalogs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_Run_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_result"); + xfer += oprot->writeStructBegin("TCLIService_Run_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -940,7 +940,7 @@ uint32_t TCLIService_GetCatalogs_result::write(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetCatalogs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_Run_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -980,7 +980,7 @@ uint32_t TCLIService_GetCatalogs_presult::read(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetSchemas_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_ExecuteTransient_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1020,9 +1020,9 @@ uint32_t TCLIService_GetSchemas_args::read(::apache::thrift::protocol::TProtocol return xfer; } -uint32_t TCLIService_GetSchemas_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_ExecuteTransient_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_args"); + xfer += oprot->writeStructBegin("TCLIService_ExecuteTransient_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1033,9 +1033,9 @@ uint32_t TCLIService_GetSchemas_args::write(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetSchemas_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_ExecuteTransient_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_pargs"); + xfer += oprot->writeStructBegin("TCLIService_ExecuteTransient_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1046,7 +1046,7 @@ uint32_t TCLIService_GetSchemas_pargs::write(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetSchemas_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_ExecuteTransient_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1086,11 +1086,11 @@ uint32_t TCLIService_GetSchemas_result::read(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetSchemas_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_ExecuteTransient_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_result"); + xfer += oprot->writeStructBegin("TCLIService_ExecuteTransient_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1102,7 +1102,7 @@ uint32_t TCLIService_GetSchemas_result::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetSchemas_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_ExecuteTransient_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1142,7 +1142,7 @@ uint32_t TCLIService_GetSchemas_presult::read(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetTables_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTypeInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1182,9 +1182,9 @@ uint32_t TCLIService_GetTables_args::read(::apache::thrift::protocol::TProtocol* return xfer; } -uint32_t TCLIService_GetTables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTypeInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTables_args"); + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1195,9 +1195,9 @@ uint32_t TCLIService_GetTables_args::write(::apache::thrift::protocol::TProtocol return xfer; } -uint32_t TCLIService_GetTables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTypeInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTables_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1208,7 +1208,7 @@ uint32_t TCLIService_GetTables_pargs::write(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetTables_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTypeInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1248,11 +1248,11 @@ uint32_t TCLIService_GetTables_result::read(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetTables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTypeInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTables_result"); + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1264,7 +1264,7 @@ uint32_t TCLIService_GetTables_result::write(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetTables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTypeInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1304,7 +1304,7 @@ uint32_t TCLIService_GetTables_presult::read(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetTableTypes_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetCatalogs_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1344,9 +1344,9 @@ uint32_t TCLIService_GetTableTypes_args::read(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetTableTypes_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetCatalogs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_args"); + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1357,9 +1357,9 @@ uint32_t TCLIService_GetTableTypes_args::write(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetTableTypes_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetCatalogs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1370,7 +1370,7 @@ uint32_t TCLIService_GetTableTypes_pargs::write(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_GetTableTypes_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetCatalogs_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1410,11 +1410,11 @@ uint32_t TCLIService_GetTableTypes_result::read(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_GetTableTypes_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetCatalogs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_result"); + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1426,7 +1426,7 @@ uint32_t TCLIService_GetTableTypes_result::write(::apache::thrift::protocol::TPr return xfer; } -uint32_t TCLIService_GetTableTypes_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetCatalogs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1466,7 +1466,7 @@ uint32_t TCLIService_GetTableTypes_presult::read(::apache::thrift::protocol::TPr return xfer; } -uint32_t TCLIService_GetColumns_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetSchemas_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1506,9 +1506,9 @@ uint32_t TCLIService_GetColumns_args::read(::apache::thrift::protocol::TProtocol return xfer; } -uint32_t TCLIService_GetColumns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetSchemas_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetColumns_args"); + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1519,9 +1519,9 @@ uint32_t TCLIService_GetColumns_args::write(::apache::thrift::protocol::TProtoco return xfer; } -uint32_t TCLIService_GetColumns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetSchemas_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetColumns_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1532,7 +1532,7 @@ uint32_t TCLIService_GetColumns_pargs::write(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetColumns_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetSchemas_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1572,11 +1572,11 @@ uint32_t TCLIService_GetColumns_result::read(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetColumns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetSchemas_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetColumns_result"); + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1588,7 +1588,7 @@ uint32_t TCLIService_GetColumns_result::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetColumns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetSchemas_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1628,7 +1628,7 @@ uint32_t TCLIService_GetColumns_presult::read(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetFunctions_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTables_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1668,9 +1668,9 @@ uint32_t TCLIService_GetFunctions_args::read(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_GetFunctions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_args"); + xfer += oprot->writeStructBegin("TCLIService_GetTables_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1681,9 +1681,9 @@ uint32_t TCLIService_GetFunctions_args::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_GetFunctions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetTables_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1694,7 +1694,7 @@ uint32_t TCLIService_GetFunctions_pargs::write(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetFunctions_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTables_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1734,11 +1734,11 @@ uint32_t TCLIService_GetFunctions_result::read(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_GetFunctions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_result"); + xfer += oprot->writeStructBegin("TCLIService_GetTables_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1750,7 +1750,7 @@ uint32_t TCLIService_GetFunctions_result::write(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_GetFunctions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1790,7 +1790,7 @@ uint32_t TCLIService_GetFunctions_presult::read(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_GetOperationStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTableTypes_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1830,9 +1830,9 @@ uint32_t TCLIService_GetOperationStatus_args::read(::apache::thrift::protocol::T return xfer; } -uint32_t TCLIService_GetOperationStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTableTypes_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_args"); + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -1843,9 +1843,9 @@ uint32_t TCLIService_GetOperationStatus_args::write(::apache::thrift::protocol:: return xfer; } -uint32_t TCLIService_GetOperationStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTableTypes_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -1856,7 +1856,7 @@ uint32_t TCLIService_GetOperationStatus_pargs::write(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_GetOperationStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTableTypes_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1896,11 +1896,11 @@ uint32_t TCLIService_GetOperationStatus_result::read(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_GetOperationStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetTableTypes_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_result"); + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -1912,7 +1912,7 @@ uint32_t TCLIService_GetOperationStatus_result::write(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_GetOperationStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetTableTypes_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1952,7 +1952,7 @@ uint32_t TCLIService_GetOperationStatus_presult::read(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_CancelOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetColumns_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1992,9 +1992,9 @@ uint32_t TCLIService_CancelOperation_args::read(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_CancelOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetColumns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_args"); + xfer += oprot->writeStructBegin("TCLIService_GetColumns_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2005,9 +2005,9 @@ uint32_t TCLIService_CancelOperation_args::write(::apache::thrift::protocol::TPr return xfer; } -uint32_t TCLIService_CancelOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetColumns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetColumns_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2018,7 +2018,7 @@ uint32_t TCLIService_CancelOperation_pargs::write(::apache::thrift::protocol::TP return xfer; } -uint32_t TCLIService_CancelOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetColumns_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2058,11 +2058,11 @@ uint32_t TCLIService_CancelOperation_result::read(::apache::thrift::protocol::TP return xfer; } -uint32_t TCLIService_CancelOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetColumns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_result"); + xfer += oprot->writeStructBegin("TCLIService_GetColumns_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2074,7 +2074,7 @@ uint32_t TCLIService_CancelOperation_result::write(::apache::thrift::protocol::T return xfer; } -uint32_t TCLIService_CancelOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetColumns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2114,7 +2114,7 @@ uint32_t TCLIService_CancelOperation_presult::read(::apache::thrift::protocol::T return xfer; } -uint32_t TCLIService_CloseOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetFunctions_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2154,9 +2154,9 @@ uint32_t TCLIService_CloseOperation_args::read(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_CloseOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetFunctions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_args"); + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2167,9 +2167,9 @@ uint32_t TCLIService_CloseOperation_args::write(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_CloseOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetFunctions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2180,7 +2180,7 @@ uint32_t TCLIService_CloseOperation_pargs::write(::apache::thrift::protocol::TPr return xfer; } -uint32_t TCLIService_CloseOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetFunctions_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2220,11 +2220,11 @@ uint32_t TCLIService_CloseOperation_result::read(::apache::thrift::protocol::TPr return xfer; } -uint32_t TCLIService_CloseOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetFunctions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_result"); + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2236,7 +2236,7 @@ uint32_t TCLIService_CloseOperation_result::write(::apache::thrift::protocol::TP return xfer; } -uint32_t TCLIService_CloseOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetFunctions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2276,7 +2276,7 @@ uint32_t TCLIService_CloseOperation_presult::read(::apache::thrift::protocol::TP return xfer; } -uint32_t TCLIService_GetResultSetMetadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetOperationStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2316,9 +2316,9 @@ uint32_t TCLIService_GetResultSetMetadata_args::read(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_GetResultSetMetadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetOperationStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_args"); + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2329,9 +2329,9 @@ uint32_t TCLIService_GetResultSetMetadata_args::write(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_GetResultSetMetadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetOperationStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2342,7 +2342,7 @@ uint32_t TCLIService_GetResultSetMetadata_pargs::write(::apache::thrift::protoco return xfer; } -uint32_t TCLIService_GetResultSetMetadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetOperationStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2382,11 +2382,11 @@ uint32_t TCLIService_GetResultSetMetadata_result::read(::apache::thrift::protoco return xfer; } -uint32_t TCLIService_GetResultSetMetadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetOperationStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_result"); + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2398,7 +2398,7 @@ uint32_t TCLIService_GetResultSetMetadata_result::write(::apache::thrift::protoc return xfer; } -uint32_t TCLIService_GetResultSetMetadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetOperationStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2438,7 +2438,7 @@ uint32_t TCLIService_GetResultSetMetadata_presult::read(::apache::thrift::protoc return xfer; } -uint32_t TCLIService_FetchResults_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CancelOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2478,9 +2478,9 @@ uint32_t TCLIService_FetchResults_args::read(::apache::thrift::protocol::TProtoc return xfer; } -uint32_t TCLIService_FetchResults_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CancelOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_FetchResults_args"); + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2491,9 +2491,9 @@ uint32_t TCLIService_FetchResults_args::write(::apache::thrift::protocol::TProto return xfer; } -uint32_t TCLIService_FetchResults_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CancelOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_FetchResults_pargs"); + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2504,7 +2504,7 @@ uint32_t TCLIService_FetchResults_pargs::write(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_FetchResults_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CancelOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2544,11 +2544,11 @@ uint32_t TCLIService_FetchResults_result::read(::apache::thrift::protocol::TProt return xfer; } -uint32_t TCLIService_FetchResults_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CancelOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_FetchResults_result"); + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2560,7 +2560,7 @@ uint32_t TCLIService_FetchResults_result::write(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_FetchResults_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CancelOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2600,7 +2600,7 @@ uint32_t TCLIService_FetchResults_presult::read(::apache::thrift::protocol::TPro return xfer; } -uint32_t TCLIService_GetDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CloseOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2640,9 +2640,9 @@ uint32_t TCLIService_GetDelegationToken_args::read(::apache::thrift::protocol::T return xfer; } -uint32_t TCLIService_GetDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CloseOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_args"); + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2653,9 +2653,9 @@ uint32_t TCLIService_GetDelegationToken_args::write(::apache::thrift::protocol:: return xfer; } -uint32_t TCLIService_GetDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CloseOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_pargs"); + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2666,7 +2666,7 @@ uint32_t TCLIService_GetDelegationToken_pargs::write(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_GetDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CloseOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2706,11 +2706,11 @@ uint32_t TCLIService_GetDelegationToken_result::read(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_GetDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_CloseOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_result"); + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2722,7 +2722,7 @@ uint32_t TCLIService_GetDelegationToken_result::write(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_GetDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_CloseOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2762,7 +2762,7 @@ uint32_t TCLIService_GetDelegationToken_presult::read(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_CancelDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetResultSetMetadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2802,9 +2802,9 @@ uint32_t TCLIService_CancelDelegationToken_args::read(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_CancelDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetResultSetMetadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_args"); + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2815,9 +2815,9 @@ uint32_t TCLIService_CancelDelegationToken_args::write(::apache::thrift::protoco return xfer; } -uint32_t TCLIService_CancelDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetResultSetMetadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_pargs"); + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2828,7 +2828,7 @@ uint32_t TCLIService_CancelDelegationToken_pargs::write(::apache::thrift::protoc return xfer; } -uint32_t TCLIService_CancelDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetResultSetMetadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2868,11 +2868,11 @@ uint32_t TCLIService_CancelDelegationToken_result::read(::apache::thrift::protoc return xfer; } -uint32_t TCLIService_CancelDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_GetResultSetMetadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_result"); + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -2884,7 +2884,7 @@ uint32_t TCLIService_CancelDelegationToken_result::write(::apache::thrift::proto return xfer; } -uint32_t TCLIService_CancelDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_GetResultSetMetadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2924,7 +2924,7 @@ uint32_t TCLIService_CancelDelegationToken_presult::read(::apache::thrift::proto return xfer; } -uint32_t TCLIService_RenewDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_FetchResults_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -2964,9 +2964,9 @@ uint32_t TCLIService_RenewDelegationToken_args::read(::apache::thrift::protocol: return xfer; } -uint32_t TCLIService_RenewDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_FetchResults_args::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_args"); + xfer += oprot->writeStructBegin("TCLIService_FetchResults_args"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += this->req.write(oprot); @@ -2977,9 +2977,9 @@ uint32_t TCLIService_RenewDelegationToken_args::write(::apache::thrift::protocol return xfer; } -uint32_t TCLIService_RenewDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_FetchResults_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_pargs"); + xfer += oprot->writeStructBegin("TCLIService_FetchResults_pargs"); xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); xfer += (*(this->req)).write(oprot); @@ -2990,7 +2990,7 @@ uint32_t TCLIService_RenewDelegationToken_pargs::write(::apache::thrift::protoco return xfer; } -uint32_t TCLIService_RenewDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_FetchResults_result::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -3030,11 +3030,11 @@ uint32_t TCLIService_RenewDelegationToken_result::read(::apache::thrift::protoco return xfer; } -uint32_t TCLIService_RenewDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TCLIService_FetchResults_result::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_result"); + xfer += oprot->writeStructBegin("TCLIService_FetchResults_result"); if (this->__isset.success) { xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); @@ -3046,7 +3046,7 @@ uint32_t TCLIService_RenewDelegationToken_result::write(::apache::thrift::protoc return xfer; } -uint32_t TCLIService_RenewDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TCLIService_FetchResults_presult::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -3086,19 +3086,621 @@ uint32_t TCLIService_RenewDelegationToken_presult::read(::apache::thrift::protoc return xfer; } -void TCLIServiceClient::OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) -{ - send_OpenSession(req); - recv_OpenSession(_return); -} - -void TCLIServiceClient::send_OpenSession(const TOpenSessionReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("OpenSession", ::apache::thrift::protocol::T_CALL, cseqid); +uint32_t TCLIService_GetDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { - TCLIService_OpenSession_pargs args; - args.req = &req; + 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->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_GetDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_GetDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_GetDelegationToken_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_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_GetDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetDelegationToken_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_GetDelegationToken_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_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_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_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_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_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_CancelDelegationToken_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_CancelDelegationToken_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_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_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_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_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_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_RenewDelegationToken_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t TCLIService_RenewDelegationToken_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_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +void TCLIServiceClient::OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) +{ + send_OpenSession(req); + recv_OpenSession(_return); +} + +void TCLIServiceClient::send_OpenSession(const TOpenSessionReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("OpenSession", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_OpenSession_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_OpenSession(TOpenSessionResp& _return) +{ + + 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(); + } + if (fname.compare("OpenSession") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_OpenSession_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "OpenSession failed: unknown result"); +} + +void TCLIServiceClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) +{ + send_CloseSession(req); + recv_CloseSession(_return); +} + +void TCLIServiceClient::send_CloseSession(const TCloseSessionReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("CloseSession", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CloseSession_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_CloseSession(TCloseSessionResp& _return) +{ + + 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(); + } + if (fname.compare("CloseSession") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_CloseSession_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseSession failed: unknown result"); +} + +void TCLIServiceClient::GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) +{ + send_GetInfo(req); + recv_GetInfo(_return); +} + +void TCLIServiceClient::send_GetInfo(const TGetInfoReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetInfo_pargs args; + args.req = &req; args.write(oprot_); oprot_->writeMessageEnd(); @@ -3106,7 +3708,7 @@ void TCLIServiceClient::send_OpenSession(const TOpenSessionReq& req) oprot_->getTransport()->flush(); } -void TCLIServiceClient::recv_OpenSession(TOpenSessionResp& _return) +void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _return) { int32_t rseqid = 0; @@ -3126,12 +3728,12 @@ void TCLIServiceClient::recv_OpenSession(TOpenSessionResp& _return) iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - if (fname.compare("OpenSession") != 0) { + if (fname.compare("GetInfo") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - TCLIService_OpenSession_presult result; + TCLIService_GetInfo_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -3141,21 +3743,21 @@ void TCLIServiceClient::recv_OpenSession(TOpenSessionResp& _return) // _return pointer has now been filled return; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "OpenSession failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetInfo failed: unknown result"); } -void TCLIServiceClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) +void TCLIServiceClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) { - send_CloseSession(req); - recv_CloseSession(_return); + send_ExecuteStatement(req); + recv_ExecuteStatement(_return); } -void TCLIServiceClient::send_CloseSession(const TCloseSessionReq& req) +void TCLIServiceClient::send_ExecuteStatement(const TExecuteStatementReq& req) { int32_t cseqid = 0; - oprot_->writeMessageBegin("CloseSession", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); - TCLIService_CloseSession_pargs args; + TCLIService_ExecuteStatement_pargs args; args.req = &req; args.write(oprot_); @@ -3164,7 +3766,7 @@ void TCLIServiceClient::send_CloseSession(const TCloseSessionReq& req) oprot_->getTransport()->flush(); } -void TCLIServiceClient::recv_CloseSession(TCloseSessionResp& _return) +void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _return) { int32_t rseqid = 0; @@ -3184,12 +3786,12 @@ void TCLIServiceClient::recv_CloseSession(TCloseSessionResp& _return) iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - if (fname.compare("CloseSession") != 0) { + if (fname.compare("ExecuteStatement") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - TCLIService_CloseSession_presult result; + TCLIService_ExecuteStatement_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -3199,21 +3801,21 @@ void TCLIServiceClient::recv_CloseSession(TCloseSessionResp& _return) // _return pointer has now been filled return; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseSession failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "ExecuteStatement failed: unknown result"); } -void TCLIServiceClient::GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) +void TCLIServiceClient::Compile(TCompileRes& _return, const TExecuteStatementReq& req) { - send_GetInfo(req); - recv_GetInfo(_return); + send_Compile(req); + recv_Compile(_return); } -void TCLIServiceClient::send_GetInfo(const TGetInfoReq& req) +void TCLIServiceClient::send_Compile(const TExecuteStatementReq& req) { int32_t cseqid = 0; - oprot_->writeMessageBegin("GetInfo", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("Compile", ::apache::thrift::protocol::T_CALL, cseqid); - TCLIService_GetInfo_pargs args; + TCLIService_Compile_pargs args; args.req = &req; args.write(oprot_); @@ -3222,7 +3824,7 @@ void TCLIServiceClient::send_GetInfo(const TGetInfoReq& req) oprot_->getTransport()->flush(); } -void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _return) +void TCLIServiceClient::recv_Compile(TCompileRes& _return) { int32_t rseqid = 0; @@ -3242,12 +3844,12 @@ void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _return) iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - if (fname.compare("GetInfo") != 0) { + if (fname.compare("Compile") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - TCLIService_GetInfo_presult result; + TCLIService_Compile_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -3257,21 +3859,21 @@ void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _return) // _return pointer has now been filled return; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetInfo failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "Compile failed: unknown result"); } -void TCLIServiceClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) +void TCLIServiceClient::Run(TStatus& _return, const TRunReq& req) { - send_ExecuteStatement(req); - recv_ExecuteStatement(_return); + send_Run(req); + recv_Run(_return); } -void TCLIServiceClient::send_ExecuteStatement(const TExecuteStatementReq& req) +void TCLIServiceClient::send_Run(const TRunReq& req) { int32_t cseqid = 0; - oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("Run", ::apache::thrift::protocol::T_CALL, cseqid); - TCLIService_ExecuteStatement_pargs args; + TCLIService_Run_pargs args; args.req = &req; args.write(oprot_); @@ -3280,7 +3882,7 @@ void TCLIServiceClient::send_ExecuteStatement(const TExecuteStatementReq& req) oprot_->getTransport()->flush(); } -void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _return) +void TCLIServiceClient::recv_Run(TStatus& _return) { int32_t rseqid = 0; @@ -3300,12 +3902,12 @@ void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _return) iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - if (fname.compare("ExecuteStatement") != 0) { + if (fname.compare("Run") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); } - TCLIService_ExecuteStatement_presult result; + TCLIService_Run_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -3315,7 +3917,65 @@ void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _return) // _return pointer has now been filled return; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "ExecuteStatement failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "Run failed: unknown result"); +} + +void TCLIServiceClient::ExecuteTransient(TStatus& _return, const TExecuteStatementReq& req) +{ + send_ExecuteTransient(req); + recv_ExecuteTransient(_return); +} + +void TCLIServiceClient::send_ExecuteTransient(const TExecuteStatementReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("ExecuteTransient", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_ExecuteTransient_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_ExecuteTransient(TStatus& _return) +{ + + 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(); + } + if (fname.compare("ExecuteTransient") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_ExecuteTransient_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "ExecuteTransient failed: unknown result"); } void TCLIServiceClient::GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) @@ -4423,6 +5083,168 @@ void TCLIServiceProcessor::process_ExecuteStatement(int32_t seqid, ::apache::thr } } +void TCLIServiceProcessor::process_Compile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("TCLIService.Compile", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.Compile"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.Compile"); + } + + TCLIService_Compile_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.Compile", bytes); + } + + TCLIService_Compile_result result; + try { + iface_->Compile(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.Compile"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("Compile", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "TCLIService.Compile"); + } + + oprot->writeMessageBegin("Compile", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "TCLIService.Compile", bytes); + } +} + +void TCLIServiceProcessor::process_Run(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("TCLIService.Run", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.Run"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.Run"); + } + + TCLIService_Run_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.Run", bytes); + } + + TCLIService_Run_result result; + try { + iface_->Run(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.Run"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("Run", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "TCLIService.Run"); + } + + oprot->writeMessageBegin("Run", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "TCLIService.Run", bytes); + } +} + +void TCLIServiceProcessor::process_ExecuteTransient(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("TCLIService.ExecuteTransient", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.ExecuteTransient"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.ExecuteTransient"); + } + + TCLIService_ExecuteTransient_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.ExecuteTransient", bytes); + } + + TCLIService_ExecuteTransient_result result; + try { + iface_->ExecuteTransient(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.ExecuteTransient"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("ExecuteTransient", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "TCLIService.ExecuteTransient"); + } + + oprot->writeMessageBegin("ExecuteTransient", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "TCLIService.ExecuteTransient", bytes); + } +} + void TCLIServiceProcessor::process_GetTypeInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; diff --git service/src/gen/thrift/gen-cpp/TCLIService.h service/src/gen/thrift/gen-cpp/TCLIService.h index 030475b..d1d0e44 100644 --- service/src/gen/thrift/gen-cpp/TCLIService.h +++ service/src/gen/thrift/gen-cpp/TCLIService.h @@ -19,6 +19,9 @@ class TCLIServiceIf { virtual void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) = 0; virtual void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) = 0; virtual void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) = 0; + virtual void Compile(TCompileRes& _return, const TExecuteStatementReq& req) = 0; + virtual void Run(TStatus& _return, const TRunReq& req) = 0; + virtual void ExecuteTransient(TStatus& _return, const TExecuteStatementReq& req) = 0; virtual void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) = 0; virtual void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) = 0; virtual void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) = 0; @@ -75,6 +78,15 @@ class TCLIServiceNull : virtual public TCLIServiceIf { void ExecuteStatement(TExecuteStatementResp& /* _return */, const TExecuteStatementReq& /* req */) { return; } + void Compile(TCompileRes& /* _return */, const TExecuteStatementReq& /* req */) { + return; + } + void Run(TStatus& /* _return */, const TRunReq& /* req */) { + return; + } + void ExecuteTransient(TStatus& /* _return */, const TExecuteStatementReq& /* req */) { + return; + } void GetTypeInfo(TGetTypeInfoResp& /* _return */, const TGetTypeInfoReq& /* req */) { return; } @@ -554,6 +566,330 @@ class TCLIService_ExecuteStatement_presult { }; +typedef struct _TCLIService_Compile_args__isset { + _TCLIService_Compile_args__isset() : req(false) {} + bool req; +} _TCLIService_Compile_args__isset; + +class TCLIService_Compile_args { + public: + + TCLIService_Compile_args() { + } + + virtual ~TCLIService_Compile_args() throw() {} + + TExecuteStatementReq req; + + _TCLIService_Compile_args__isset __isset; + + void __set_req(const TExecuteStatementReq& val) { + req = val; + } + + bool operator == (const TCLIService_Compile_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_Compile_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_Compile_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_Compile_pargs { + public: + + + virtual ~TCLIService_Compile_pargs() throw() {} + + const TExecuteStatementReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_Compile_result__isset { + _TCLIService_Compile_result__isset() : success(false) {} + bool success; +} _TCLIService_Compile_result__isset; + +class TCLIService_Compile_result { + public: + + TCLIService_Compile_result() { + } + + virtual ~TCLIService_Compile_result() throw() {} + + TCompileRes success; + + _TCLIService_Compile_result__isset __isset; + + void __set_success(const TCompileRes& val) { + success = val; + } + + bool operator == (const TCLIService_Compile_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_Compile_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_Compile_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_Compile_presult__isset { + _TCLIService_Compile_presult__isset() : success(false) {} + bool success; +} _TCLIService_Compile_presult__isset; + +class TCLIService_Compile_presult { + public: + + + virtual ~TCLIService_Compile_presult() throw() {} + + TCompileRes* success; + + _TCLIService_Compile_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_Run_args__isset { + _TCLIService_Run_args__isset() : req(false) {} + bool req; +} _TCLIService_Run_args__isset; + +class TCLIService_Run_args { + public: + + TCLIService_Run_args() { + } + + virtual ~TCLIService_Run_args() throw() {} + + TRunReq req; + + _TCLIService_Run_args__isset __isset; + + void __set_req(const TRunReq& val) { + req = val; + } + + bool operator == (const TCLIService_Run_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_Run_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_Run_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_Run_pargs { + public: + + + virtual ~TCLIService_Run_pargs() throw() {} + + const TRunReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_Run_result__isset { + _TCLIService_Run_result__isset() : success(false) {} + bool success; +} _TCLIService_Run_result__isset; + +class TCLIService_Run_result { + public: + + TCLIService_Run_result() { + } + + virtual ~TCLIService_Run_result() throw() {} + + TStatus success; + + _TCLIService_Run_result__isset __isset; + + void __set_success(const TStatus& val) { + success = val; + } + + bool operator == (const TCLIService_Run_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_Run_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_Run_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_Run_presult__isset { + _TCLIService_Run_presult__isset() : success(false) {} + bool success; +} _TCLIService_Run_presult__isset; + +class TCLIService_Run_presult { + public: + + + virtual ~TCLIService_Run_presult() throw() {} + + TStatus* success; + + _TCLIService_Run_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_ExecuteTransient_args__isset { + _TCLIService_ExecuteTransient_args__isset() : req(false) {} + bool req; +} _TCLIService_ExecuteTransient_args__isset; + +class TCLIService_ExecuteTransient_args { + public: + + TCLIService_ExecuteTransient_args() { + } + + virtual ~TCLIService_ExecuteTransient_args() throw() {} + + TExecuteStatementReq req; + + _TCLIService_ExecuteTransient_args__isset __isset; + + void __set_req(const TExecuteStatementReq& val) { + req = val; + } + + bool operator == (const TCLIService_ExecuteTransient_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_ExecuteTransient_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_ExecuteTransient_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_ExecuteTransient_pargs { + public: + + + virtual ~TCLIService_ExecuteTransient_pargs() throw() {} + + const TExecuteStatementReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_ExecuteTransient_result__isset { + _TCLIService_ExecuteTransient_result__isset() : success(false) {} + bool success; +} _TCLIService_ExecuteTransient_result__isset; + +class TCLIService_ExecuteTransient_result { + public: + + TCLIService_ExecuteTransient_result() { + } + + virtual ~TCLIService_ExecuteTransient_result() throw() {} + + TStatus success; + + _TCLIService_ExecuteTransient_result__isset __isset; + + void __set_success(const TStatus& val) { + success = val; + } + + bool operator == (const TCLIService_ExecuteTransient_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_ExecuteTransient_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_ExecuteTransient_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_ExecuteTransient_presult__isset { + _TCLIService_ExecuteTransient_presult__isset() : success(false) {} + bool success; +} _TCLIService_ExecuteTransient_presult__isset; + +class TCLIService_ExecuteTransient_presult { + public: + + + virtual ~TCLIService_ExecuteTransient_presult() throw() {} + + TStatus* success; + + _TCLIService_ExecuteTransient_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _TCLIService_GetTypeInfo_args__isset { _TCLIService_GetTypeInfo_args__isset() : req(false) {} bool req; @@ -2206,6 +2542,15 @@ class TCLIServiceClient : virtual public TCLIServiceIf { void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req); void send_ExecuteStatement(const TExecuteStatementReq& req); void recv_ExecuteStatement(TExecuteStatementResp& _return); + void Compile(TCompileRes& _return, const TExecuteStatementReq& req); + void send_Compile(const TExecuteStatementReq& req); + void recv_Compile(TCompileRes& _return); + void Run(TStatus& _return, const TRunReq& req); + void send_Run(const TRunReq& req); + void recv_Run(TStatus& _return); + void ExecuteTransient(TStatus& _return, const TExecuteStatementReq& req); + void send_ExecuteTransient(const TExecuteStatementReq& req); + void recv_ExecuteTransient(TStatus& _return); void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req); void send_GetTypeInfo(const TGetTypeInfoReq& req); void recv_GetTypeInfo(TGetTypeInfoResp& _return); @@ -2270,6 +2615,9 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { void process_CloseSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_GetInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_ExecuteStatement(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_Compile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_Run(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_ExecuteTransient(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_GetTypeInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_GetCatalogs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_GetSchemas(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -2292,6 +2640,9 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { processMap_["CloseSession"] = &TCLIServiceProcessor::process_CloseSession; processMap_["GetInfo"] = &TCLIServiceProcessor::process_GetInfo; processMap_["ExecuteStatement"] = &TCLIServiceProcessor::process_ExecuteStatement; + processMap_["Compile"] = &TCLIServiceProcessor::process_Compile; + processMap_["Run"] = &TCLIServiceProcessor::process_Run; + processMap_["ExecuteTransient"] = &TCLIServiceProcessor::process_ExecuteTransient; processMap_["GetTypeInfo"] = &TCLIServiceProcessor::process_GetTypeInfo; processMap_["GetCatalogs"] = &TCLIServiceProcessor::process_GetCatalogs; processMap_["GetSchemas"] = &TCLIServiceProcessor::process_GetSchemas; @@ -2375,6 +2726,36 @@ class TCLIServiceMultiface : virtual public TCLIServiceIf { return; } + void Compile(TCompileRes& _return, const TExecuteStatementReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->Compile(_return, req); + } + ifaces_[i]->Compile(_return, req); + return; + } + + void Run(TStatus& _return, const TRunReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->Run(_return, req); + } + ifaces_[i]->Run(_return, req); + return; + } + + void ExecuteTransient(TStatus& _return, const TExecuteStatementReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->ExecuteTransient(_return, req); + } + ifaces_[i]->ExecuteTransient(_return, req); + return; + } + void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) { size_t sz = ifaces_.size(); size_t i = 0; diff --git service/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp service/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp index 988bb4c..dae32c3 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp +++ service/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp @@ -42,6 +42,21 @@ class TCLIServiceHandler : virtual public TCLIServiceIf { printf("ExecuteStatement\n"); } + void Compile(TCompileRes& _return, const TExecuteStatementReq& req) { + // Your implementation goes here + printf("Compile\n"); + } + + void Run(TStatus& _return, const TRunReq& req) { + // Your implementation goes here + printf("Run\n"); + } + + void ExecuteTransient(TStatus& _return, const TExecuteStatementReq& req) { + // Your implementation goes here + printf("ExecuteTransient\n"); + } + void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) { // Your implementation goes here printf("GetTypeInfo\n"); diff --git service/src/gen/thrift/gen-cpp/TCLIService_types.cpp service/src/gen/thrift/gen-cpp/TCLIService_types.cpp index 326d25b..630f677 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ service/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -6806,4 +6806,179 @@ void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b) { swap(a.status, b.status); } +const char* TCompileRes::ascii_fingerprint = "0109DD9AF87F9C16A0392FEEF0301D54"; +const uint8_t TCompileRes::binary_fingerprint[16] = {0x01,0x09,0xDD,0x9A,0xF8,0x7F,0x9C,0x16,0xA0,0x39,0x2F,0xEE,0xF0,0x30,0x1D,0x54}; + +uint32_t TCompileRes::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; + + bool isset_status = false; + bool isset_operationHandle = false; + + 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->status.read(iprot); + isset_status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->operationHandle.read(iprot); + isset_operationHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->queryPlan.read(iprot); + this->__isset.queryPlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCompileRes::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TCompileRes"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.queryPlan) { + xfer += oprot->writeFieldBegin("queryPlan", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->queryPlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCompileRes &a, TCompileRes &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.queryPlan, b.queryPlan); + swap(a.__isset, b.__isset); +} + +const char* TRunReq::ascii_fingerprint = "A9814AAA9B38DC20E9E64AA8FF529EC3"; +const uint8_t TRunReq::binary_fingerprint[16] = {0xA9,0x81,0x4A,0xAA,0x9B,0x38,0xDC,0x20,0xE9,0xE6,0x4A,0xA8,0xFF,0x52,0x9E,0xC3}; + +uint32_t TRunReq::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; + + bool isset_sessionHandle = false; + bool isset_operationHandle = false; + + 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->sessionHandle.read(iprot); + isset_sessionHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->operationHandle.read(iprot); + isset_operationHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRunReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TRunReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRunReq &a, TRunReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.operationHandle, b.operationHandle); +} + }}}}} // namespace diff --git service/src/gen/thrift/gen-cpp/TCLIService_types.h service/src/gen/thrift/gen-cpp/TCLIService_types.h index f32dc3c..b98ce97 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.h +++ service/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -12,6 +12,7 @@ #include #include +#include "queryplan_types.h" namespace apache { namespace hive { namespace service { namespace cli { namespace thrift { @@ -4001,6 +4002,110 @@ class TRenewDelegationTokenResp { void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b); +typedef struct _TCompileRes__isset { + _TCompileRes__isset() : queryPlan(false) {} + bool queryPlan; +} _TCompileRes__isset; + +class TCompileRes { + public: + + static const char* ascii_fingerprint; // = "0109DD9AF87F9C16A0392FEEF0301D54"; + static const uint8_t binary_fingerprint[16]; // = {0x01,0x09,0xDD,0x9A,0xF8,0x7F,0x9C,0x16,0xA0,0x39,0x2F,0xEE,0xF0,0x30,0x1D,0x54}; + + TCompileRes() { + } + + virtual ~TCompileRes() throw() {} + + TStatus status; + TOperationHandle operationHandle; + ::Apache::Hadoop::Hive::Query queryPlan; + + _TCompileRes__isset __isset; + + void __set_status(const TStatus& val) { + status = val; + } + + void __set_operationHandle(const TOperationHandle& val) { + operationHandle = val; + } + + void __set_queryPlan(const ::Apache::Hadoop::Hive::Query& val) { + queryPlan = val; + __isset.queryPlan = true; + } + + bool operator == (const TCompileRes & rhs) const + { + if (!(status == rhs.status)) + return false; + if (!(operationHandle == rhs.operationHandle)) + return false; + if (__isset.queryPlan != rhs.__isset.queryPlan) + return false; + else if (__isset.queryPlan && !(queryPlan == rhs.queryPlan)) + return false; + return true; + } + bool operator != (const TCompileRes &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCompileRes & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +void swap(TCompileRes &a, TCompileRes &b); + + +class TRunReq { + public: + + static const char* ascii_fingerprint; // = "A9814AAA9B38DC20E9E64AA8FF529EC3"; + static const uint8_t binary_fingerprint[16]; // = {0xA9,0x81,0x4A,0xAA,0x9B,0x38,0xDC,0x20,0xE9,0xE6,0x4A,0xA8,0xFF,0x52,0x9E,0xC3}; + + TRunReq() { + } + + virtual ~TRunReq() throw() {} + + TSessionHandle sessionHandle; + TOperationHandle operationHandle; + + void __set_sessionHandle(const TSessionHandle& val) { + sessionHandle = val; + } + + void __set_operationHandle(const TOperationHandle& val) { + operationHandle = val; + } + + bool operator == (const TRunReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TRunReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRunReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +void swap(TRunReq &a, TRunReq &b); + }}}}} // namespace #endif diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCLIService.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCLIService.java index 54851b8..686a44d 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCLIService.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCLIService.java @@ -43,6 +43,12 @@ public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException; + public TCompileRes Compile(TExecuteStatementReq req) throws org.apache.thrift.TException; + + public TStatus Run(TRunReq req) throws org.apache.thrift.TException; + + public TStatus ExecuteTransient(TExecuteStatementReq req) throws org.apache.thrift.TException; + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException; public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException; @@ -85,6 +91,12 @@ public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void Compile(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void Run(TRunReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void ExecuteTransient(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -229,6 +241,75 @@ public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TE throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); } + public TCompileRes Compile(TExecuteStatementReq req) throws org.apache.thrift.TException + { + send_Compile(req); + return recv_Compile(); + } + + public void send_Compile(TExecuteStatementReq req) throws org.apache.thrift.TException + { + Compile_args args = new Compile_args(); + args.setReq(req); + sendBase("Compile", args); + } + + public TCompileRes recv_Compile() throws org.apache.thrift.TException + { + Compile_result result = new Compile_result(); + receiveBase(result, "Compile"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "Compile failed: unknown result"); + } + + public TStatus Run(TRunReq req) throws org.apache.thrift.TException + { + send_Run(req); + return recv_Run(); + } + + public void send_Run(TRunReq req) throws org.apache.thrift.TException + { + Run_args args = new Run_args(); + args.setReq(req); + sendBase("Run", args); + } + + public TStatus recv_Run() throws org.apache.thrift.TException + { + Run_result result = new Run_result(); + receiveBase(result, "Run"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "Run failed: unknown result"); + } + + public TStatus ExecuteTransient(TExecuteStatementReq req) throws org.apache.thrift.TException + { + send_ExecuteTransient(req); + return recv_ExecuteTransient(); + } + + public void send_ExecuteTransient(TExecuteStatementReq req) throws org.apache.thrift.TException + { + ExecuteTransient_args args = new ExecuteTransient_args(); + args.setReq(req); + sendBase("ExecuteTransient", args); + } + + public TStatus recv_ExecuteTransient() throws org.apache.thrift.TException + { + ExecuteTransient_result result = new ExecuteTransient_result(); + receiveBase(result, "ExecuteTransient"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteTransient failed: unknown result"); + } + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException { send_GetTypeInfo(req); @@ -720,6 +801,102 @@ public TExecuteStatementResp getResult() throws org.apache.thrift.TException { } } + public void Compile(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + Compile_call method_call = new Compile_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class Compile_call extends org.apache.thrift.async.TAsyncMethodCall { + private TExecuteStatementReq req; + public Compile_call(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.req = req; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("Compile", org.apache.thrift.protocol.TMessageType.CALL, 0)); + Compile_args args = new Compile_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCompileRes getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_Compile(); + } + } + + public void Run(TRunReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + Run_call method_call = new Run_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class Run_call extends org.apache.thrift.async.TAsyncMethodCall { + private TRunReq req; + public Run_call(TRunReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.req = req; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("Run", org.apache.thrift.protocol.TMessageType.CALL, 0)); + Run_args args = new Run_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_Run(); + } + } + + public void ExecuteTransient(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + ExecuteTransient_call method_call = new ExecuteTransient_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class ExecuteTransient_call extends org.apache.thrift.async.TAsyncMethodCall { + private TExecuteStatementReq req; + public ExecuteTransient_call(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.req = req; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ExecuteTransient", org.apache.thrift.protocol.TMessageType.CALL, 0)); + ExecuteTransient_args args = new ExecuteTransient_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TStatus getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_ExecuteTransient(); + } + } + public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetTypeInfo_call method_call = new GetTypeInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); @@ -1217,6 +1394,9 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public Compile() { + super("Compile"); + } + + public Compile_args getEmptyArgsInstance() { + return new Compile_args(); + } + + protected boolean isOneway() { + return false; + } + + public Compile_result getResult(I iface, Compile_args args) throws org.apache.thrift.TException { + Compile_result result = new Compile_result(); + result.success = iface.Compile(args.req); + return result; + } + } + + public static class Run extends org.apache.thrift.ProcessFunction { + public Run() { + super("Run"); + } + + public Run_args getEmptyArgsInstance() { + return new Run_args(); + } + + protected boolean isOneway() { + return false; + } + + public Run_result getResult(I iface, Run_args args) throws org.apache.thrift.TException { + Run_result result = new Run_result(); + result.success = iface.Run(args.req); + return result; + } + } + + public static class ExecuteTransient extends org.apache.thrift.ProcessFunction { + public ExecuteTransient() { + super("ExecuteTransient"); + } + + public ExecuteTransient_args getEmptyArgsInstance() { + return new ExecuteTransient_args(); + } + + protected boolean isOneway() { + return false; + } + + public ExecuteTransient_result getResult(I iface, ExecuteTransient_args args) throws org.apache.thrift.TException { + ExecuteTransient_result result = new ExecuteTransient_result(); + result.success = iface.ExecuteTransient(args.req); + return result; + } + } + public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { public GetTypeInfo() { super("GetTypeInfo"); @@ -4521,6 +4761,2184 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_res } + public static class Compile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Compile_args"); + + private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new Compile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new Compile_argsTupleSchemeFactory()); + } + + private TExecuteStatementReq req; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + REQ((short)1, "req"); + + 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: // REQ + return REQ; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Compile_args.class, metaDataMap); + } + + public Compile_args() { + } + + public Compile_args( + TExecuteStatementReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public Compile_args(Compile_args other) { + if (other.isSetReq()) { + this.req = new TExecuteStatementReq(other.req); + } + } + + public Compile_args deepCopy() { + return new Compile_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TExecuteStatementReq getReq() { + return this.req; + } + + public void setReq(TExecuteStatementReq req) { + this.req = req; + } + + public void unsetReq() { + this.req = null; + } + + /** Returns true if field req is set (has been assigned a value) and false otherwise */ + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean value) { + if (!value) { + this.req = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TExecuteStatementReq)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Compile_args) + return this.equals((Compile_args)that); + return false; + } + + public boolean equals(Compile_args that) { + if (that == null) + return false; + + boolean this_present_req = true && this.isSetReq(); + boolean that_present_req = true && that.isSetReq(); + if (this_present_req || that_present_req) { + if (!(this_present_req && that_present_req)) + return false; + if (!this.req.equals(that.req)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_req = true && (isSetReq()); + builder.append(present_req); + if (present_req) + builder.append(req); + + return builder.toHashCode(); + } + + public int compareTo(Compile_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Compile_args typedOther = (Compile_args)other; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Compile_args("); + boolean first = true; + + sb.append("req:"); + if (this.req == null) { + sb.append("null"); + } else { + sb.append(this.req); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (req != null) { + req.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class Compile_argsStandardSchemeFactory implements SchemeFactory { + public Compile_argsStandardScheme getScheme() { + return new Compile_argsStandardScheme(); + } + } + + private static class Compile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Compile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // REQ + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.req = new TExecuteStatementReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Compile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + struct.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class Compile_argsTupleSchemeFactory implements SchemeFactory { + public Compile_argsTupleScheme getScheme() { + return new Compile_argsTupleScheme(); + } + } + + private static class Compile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Compile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetReq()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetReq()) { + struct.req.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Compile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TExecuteStatementReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + public static class Compile_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Compile_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new Compile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new Compile_resultTupleSchemeFactory()); + } + + private TCompileRes success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + 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; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCompileRes.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Compile_result.class, metaDataMap); + } + + public Compile_result() { + } + + public Compile_result( + TCompileRes success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public Compile_result(Compile_result other) { + if (other.isSetSuccess()) { + this.success = new TCompileRes(other.success); + } + } + + public Compile_result deepCopy() { + return new Compile_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TCompileRes getSuccess() { + return this.success; + } + + public void setSuccess(TCompileRes success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TCompileRes)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Compile_result) + return this.equals((Compile_result)that); + return false; + } + + public boolean equals(Compile_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (isSetSuccess()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(Compile_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Compile_result typedOther = (Compile_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Compile_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class Compile_resultStandardSchemeFactory implements SchemeFactory { + public Compile_resultStandardScheme getScheme() { + return new Compile_resultStandardScheme(); + } + } + + private static class Compile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Compile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TCompileRes(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Compile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class Compile_resultTupleSchemeFactory implements SchemeFactory { + public Compile_resultTupleScheme getScheme() { + return new Compile_resultTupleScheme(); + } + } + + private static class Compile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Compile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Compile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCompileRes(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class Run_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Run_args"); + + private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new Run_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new Run_argsTupleSchemeFactory()); + } + + private TRunReq req; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + REQ((short)1, "req"); + + 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: // REQ + return REQ; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRunReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Run_args.class, metaDataMap); + } + + public Run_args() { + } + + public Run_args( + TRunReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public Run_args(Run_args other) { + if (other.isSetReq()) { + this.req = new TRunReq(other.req); + } + } + + public Run_args deepCopy() { + return new Run_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TRunReq getReq() { + return this.req; + } + + public void setReq(TRunReq req) { + this.req = req; + } + + public void unsetReq() { + this.req = null; + } + + /** Returns true if field req is set (has been assigned a value) and false otherwise */ + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean value) { + if (!value) { + this.req = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TRunReq)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Run_args) + return this.equals((Run_args)that); + return false; + } + + public boolean equals(Run_args that) { + if (that == null) + return false; + + boolean this_present_req = true && this.isSetReq(); + boolean that_present_req = true && that.isSetReq(); + if (this_present_req || that_present_req) { + if (!(this_present_req && that_present_req)) + return false; + if (!this.req.equals(that.req)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_req = true && (isSetReq()); + builder.append(present_req); + if (present_req) + builder.append(req); + + return builder.toHashCode(); + } + + public int compareTo(Run_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Run_args typedOther = (Run_args)other; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Run_args("); + boolean first = true; + + sb.append("req:"); + if (this.req == null) { + sb.append("null"); + } else { + sb.append(this.req); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (req != null) { + req.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class Run_argsStandardSchemeFactory implements SchemeFactory { + public Run_argsStandardScheme getScheme() { + return new Run_argsStandardScheme(); + } + } + + private static class Run_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Run_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // REQ + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.req = new TRunReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Run_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + struct.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class Run_argsTupleSchemeFactory implements SchemeFactory { + public Run_argsTupleScheme getScheme() { + return new Run_argsTupleScheme(); + } + } + + private static class Run_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Run_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetReq()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetReq()) { + struct.req.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Run_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TRunReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + public static class Run_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Run_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new Run_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new Run_resultTupleSchemeFactory()); + } + + private TStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + 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; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Run_result.class, metaDataMap); + } + + public Run_result() { + } + + public Run_result( + TStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public Run_result(Run_result other) { + if (other.isSetSuccess()) { + this.success = new TStatus(other.success); + } + } + + public Run_result deepCopy() { + return new Run_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TStatus getSuccess() { + return this.success; + } + + public void setSuccess(TStatus success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Run_result) + return this.equals((Run_result)that); + return false; + } + + public boolean equals(Run_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (isSetSuccess()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(Run_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Run_result typedOther = (Run_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Run_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class Run_resultStandardSchemeFactory implements SchemeFactory { + public Run_resultStandardScheme getScheme() { + return new Run_resultStandardScheme(); + } + } + + private static class Run_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Run_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Run_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class Run_resultTupleSchemeFactory implements SchemeFactory { + public Run_resultTupleScheme getScheme() { + return new Run_resultTupleScheme(); + } + } + + private static class Run_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Run_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Run_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class ExecuteTransient_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteTransient_args"); + + private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ExecuteTransient_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteTransient_argsTupleSchemeFactory()); + } + + private TExecuteStatementReq req; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + REQ((short)1, "req"); + + 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: // REQ + return REQ; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteTransient_args.class, metaDataMap); + } + + public ExecuteTransient_args() { + } + + public ExecuteTransient_args( + TExecuteStatementReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteTransient_args(ExecuteTransient_args other) { + if (other.isSetReq()) { + this.req = new TExecuteStatementReq(other.req); + } + } + + public ExecuteTransient_args deepCopy() { + return new ExecuteTransient_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TExecuteStatementReq getReq() { + return this.req; + } + + public void setReq(TExecuteStatementReq req) { + this.req = req; + } + + public void unsetReq() { + this.req = null; + } + + /** Returns true if field req is set (has been assigned a value) and false otherwise */ + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean value) { + if (!value) { + this.req = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TExecuteStatementReq)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ExecuteTransient_args) + return this.equals((ExecuteTransient_args)that); + return false; + } + + public boolean equals(ExecuteTransient_args that) { + if (that == null) + return false; + + boolean this_present_req = true && this.isSetReq(); + boolean that_present_req = true && that.isSetReq(); + if (this_present_req || that_present_req) { + if (!(this_present_req && that_present_req)) + return false; + if (!this.req.equals(that.req)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_req = true && (isSetReq()); + builder.append(present_req); + if (present_req) + builder.append(req); + + return builder.toHashCode(); + } + + public int compareTo(ExecuteTransient_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ExecuteTransient_args typedOther = (ExecuteTransient_args)other; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ExecuteTransient_args("); + boolean first = true; + + sb.append("req:"); + if (this.req == null) { + sb.append("null"); + } else { + sb.append(this.req); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (req != null) { + req.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ExecuteTransient_argsStandardSchemeFactory implements SchemeFactory { + public ExecuteTransient_argsStandardScheme getScheme() { + return new ExecuteTransient_argsStandardScheme(); + } + } + + private static class ExecuteTransient_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteTransient_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // REQ + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.req = new TExecuteStatementReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteTransient_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + struct.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ExecuteTransient_argsTupleSchemeFactory implements SchemeFactory { + public ExecuteTransient_argsTupleScheme getScheme() { + return new ExecuteTransient_argsTupleScheme(); + } + } + + private static class ExecuteTransient_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteTransient_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetReq()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetReq()) { + struct.req.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteTransient_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TExecuteStatementReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + public static class ExecuteTransient_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteTransient_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ExecuteTransient_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteTransient_resultTupleSchemeFactory()); + } + + private TStatus success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + 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; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteTransient_result.class, metaDataMap); + } + + public ExecuteTransient_result() { + } + + public ExecuteTransient_result( + TStatus success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteTransient_result(ExecuteTransient_result other) { + if (other.isSetSuccess()) { + this.success = new TStatus(other.success); + } + } + + public ExecuteTransient_result deepCopy() { + return new ExecuteTransient_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TStatus getSuccess() { + return this.success; + } + + public void setSuccess(TStatus success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ExecuteTransient_result) + return this.equals((ExecuteTransient_result)that); + return false; + } + + public boolean equals(ExecuteTransient_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (isSetSuccess()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(ExecuteTransient_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ExecuteTransient_result typedOther = (ExecuteTransient_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ExecuteTransient_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ExecuteTransient_resultStandardSchemeFactory implements SchemeFactory { + public ExecuteTransient_resultStandardScheme getScheme() { + return new ExecuteTransient_resultStandardScheme(); + } + } + + private static class ExecuteTransient_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteTransient_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteTransient_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ExecuteTransient_resultTupleSchemeFactory implements SchemeFactory { + public ExecuteTransient_resultTupleScheme getScheme() { + return new ExecuteTransient_resultTupleScheme(); + } + } + + private static class ExecuteTransient_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteTransient_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteTransient_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_args"); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCompileRes.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCompileRes.java new file mode 100644 index 0000000..c41a1f6 --- /dev/null +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TCompileRes.java @@ -0,0 +1,611 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hive.service.cli.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +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; + +public class TCompileRes implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCompileRes"); + + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField QUERY_PLAN_FIELD_DESC = new org.apache.thrift.protocol.TField("queryPlan", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCompileResStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCompileResTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // required + private org.apache.hadoop.hive.ql.plan.api.Query queryPlan; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + STATUS((short)1, "status"), + OPERATION_HANDLE((short)2, "operationHandle"), + QUERY_PLAN((short)3, "queryPlan"); + + 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: // STATUS + return STATUS; + case 2: // OPERATION_HANDLE + return OPERATION_HANDLE; + case 3: // QUERY_PLAN + return QUERY_PLAN; + 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 _Fields optionals[] = {_Fields.QUERY_PLAN}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); + tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + tmpMap.put(_Fields.QUERY_PLAN, new org.apache.thrift.meta_data.FieldMetaData("queryPlan", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.hadoop.hive.ql.plan.api.Query.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCompileRes.class, metaDataMap); + } + + public TCompileRes() { + } + + public TCompileRes( + TStatus status, + TOperationHandle operationHandle) + { + this(); + this.status = status; + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCompileRes(TCompileRes other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + if (other.isSetQueryPlan()) { + this.queryPlan = new org.apache.hadoop.hive.ql.plan.api.Query(other.queryPlan); + } + } + + public TCompileRes deepCopy() { + return new TCompileRes(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + this.queryPlan = null; + } + + public TStatus getStatus() { + return this.status; + } + + public void setStatus(TStatus status) { + this.status = status; + } + + public void unsetStatus() { + this.status = null; + } + + /** Returns true if field status is set (has been assigned a value) and false otherwise */ + public boolean isSetStatus() { + return this.status != null; + } + + public void setStatusIsSet(boolean value) { + if (!value) { + this.status = null; + } + } + + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(TOperationHandle operationHandle) { + this.operationHandle = operationHandle; + } + + public void unsetOperationHandle() { + this.operationHandle = null; + } + + /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationHandle() { + return this.operationHandle != null; + } + + public void setOperationHandleIsSet(boolean value) { + if (!value) { + this.operationHandle = null; + } + } + + public org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan() { + return this.queryPlan; + } + + public void setQueryPlan(org.apache.hadoop.hive.ql.plan.api.Query queryPlan) { + this.queryPlan = queryPlan; + } + + public void unsetQueryPlan() { + this.queryPlan = null; + } + + /** Returns true if field queryPlan is set (has been assigned a value) and false otherwise */ + public boolean isSetQueryPlan() { + return this.queryPlan != null; + } + + public void setQueryPlanIsSet(boolean value) { + if (!value) { + this.queryPlan = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + case QUERY_PLAN: + if (value == null) { + unsetQueryPlan(); + } else { + setQueryPlan((org.apache.hadoop.hive.ql.plan.api.Query)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + case QUERY_PLAN: + return getQueryPlan(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + case QUERY_PLAN: + return isSetQueryPlan(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCompileRes) + return this.equals((TCompileRes)that); + return false; + } + + public boolean equals(TCompileRes that) { + if (that == null) + return false; + + boolean this_present_status = true && this.isSetStatus(); + boolean that_present_status = true && that.isSetStatus(); + if (this_present_status || that_present_status) { + if (!(this_present_status && that_present_status)) + return false; + if (!this.status.equals(that.status)) + return false; + } + + boolean this_present_operationHandle = true && this.isSetOperationHandle(); + boolean that_present_operationHandle = true && that.isSetOperationHandle(); + if (this_present_operationHandle || that_present_operationHandle) { + if (!(this_present_operationHandle && that_present_operationHandle)) + return false; + if (!this.operationHandle.equals(that.operationHandle)) + return false; + } + + boolean this_present_queryPlan = true && this.isSetQueryPlan(); + boolean that_present_queryPlan = true && that.isSetQueryPlan(); + if (this_present_queryPlan || that_present_queryPlan) { + if (!(this_present_queryPlan && that_present_queryPlan)) + return false; + if (!this.queryPlan.equals(that.queryPlan)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_status = true && (isSetStatus()); + builder.append(present_status); + if (present_status) + builder.append(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + builder.append(present_operationHandle); + if (present_operationHandle) + builder.append(operationHandle); + + boolean present_queryPlan = true && (isSetQueryPlan()); + builder.append(present_queryPlan); + if (present_queryPlan) + builder.append(queryPlan); + + return builder.toHashCode(); + } + + public int compareTo(TCompileRes other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TCompileRes typedOther = (TCompileRes)other; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetQueryPlan()).compareTo(typedOther.isSetQueryPlan()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryPlan()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryPlan, typedOther.queryPlan); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TCompileRes("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (!first) sb.append(", "); + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + if (isSetQueryPlan()) { + if (!first) sb.append(", "); + sb.append("queryPlan:"); + if (this.queryPlan == null) { + sb.append("null"); + } else { + sb.append(this.queryPlan); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (operationHandle != null) { + operationHandle.validate(); + } + if (queryPlan != null) { + queryPlan.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TCompileResStandardSchemeFactory implements SchemeFactory { + public TCompileResStandardScheme getScheme() { + return new TCompileResStandardScheme(); + } + } + + private static class TCompileResStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCompileRes struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPERATION_HANDLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // QUERY_PLAN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.queryPlan = new org.apache.hadoop.hive.ql.plan.api.Query(); + struct.queryPlan.read(iprot); + struct.setQueryPlanIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TCompileRes struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + struct.status.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.queryPlan != null) { + if (struct.isSetQueryPlan()) { + oprot.writeFieldBegin(QUERY_PLAN_FIELD_DESC); + struct.queryPlan.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCompileResTupleSchemeFactory implements SchemeFactory { + public TCompileResTupleScheme getScheme() { + return new TCompileResTupleScheme(); + } + } + + private static class TCompileResTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCompileRes struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + struct.operationHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetQueryPlan()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetQueryPlan()) { + struct.queryPlan.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCompileRes struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.queryPlan = new org.apache.hadoop.hive.ql.plan.api.Query(); + struct.queryPlan.read(iprot); + struct.setQueryPlanIsSet(true); + } + } + } + +} + diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRunReq.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRunReq.java new file mode 100644 index 0000000..1ab7c10 --- /dev/null +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRunReq.java @@ -0,0 +1,496 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hive.service.cli.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +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; + +public class TRunReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRunReq"); + + private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRunReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRunReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private TOperationHandle operationHandle; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SESSION_HANDLE((short)1, "sessionHandle"), + OPERATION_HANDLE((short)2, "operationHandle"); + + 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: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // OPERATION_HANDLE + return OPERATION_HANDLE; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); + tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRunReq.class, metaDataMap); + } + + public TRunReq() { + } + + public TRunReq( + TSessionHandle sessionHandle, + TOperationHandle operationHandle) + { + this(); + this.sessionHandle = sessionHandle; + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TRunReq(TRunReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TRunReq deepCopy() { + return new TRunReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.operationHandle = null; + } + + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(TSessionHandle sessionHandle) { + this.sessionHandle = sessionHandle; + } + + public void unsetSessionHandle() { + this.sessionHandle = null; + } + + /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionHandle() { + return this.sessionHandle != null; + } + + public void setSessionHandleIsSet(boolean value) { + if (!value) { + this.sessionHandle = null; + } + } + + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(TOperationHandle operationHandle) { + this.operationHandle = operationHandle; + } + + public void unsetOperationHandle() { + this.operationHandle = null; + } + + /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationHandle() { + return this.operationHandle != null; + } + + public void setOperationHandleIsSet(boolean value) { + if (!value) { + this.operationHandle = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRunReq) + return this.equals((TRunReq)that); + return false; + } + + public boolean equals(TRunReq that) { + if (that == null) + return false; + + boolean this_present_sessionHandle = true && this.isSetSessionHandle(); + boolean that_present_sessionHandle = true && that.isSetSessionHandle(); + if (this_present_sessionHandle || that_present_sessionHandle) { + if (!(this_present_sessionHandle && that_present_sessionHandle)) + return false; + if (!this.sessionHandle.equals(that.sessionHandle)) + return false; + } + + boolean this_present_operationHandle = true && this.isSetOperationHandle(); + boolean that_present_operationHandle = true && that.isSetOperationHandle(); + if (this_present_operationHandle || that_present_operationHandle) { + if (!(this_present_operationHandle && that_present_operationHandle)) + return false; + if (!this.operationHandle.equals(that.operationHandle)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + builder.append(present_sessionHandle); + if (present_sessionHandle) + builder.append(sessionHandle); + + boolean present_operationHandle = true && (isSetOperationHandle()); + builder.append(present_operationHandle); + if (present_operationHandle) + builder.append(operationHandle); + + return builder.toHashCode(); + } + + public int compareTo(TRunReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TRunReq typedOther = (TRunReq)other; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TRunReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (!first) sb.append(", "); + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetSessionHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); + } + + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.validate(); + } + if (operationHandle != null) { + operationHandle.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TRunReqStandardSchemeFactory implements SchemeFactory { + public TRunReqStandardScheme getScheme() { + return new TRunReqStandardScheme(); + } + } + + private static class TRunReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRunReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // SESSION_HANDLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPERATION_HANDLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TRunReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.sessionHandle != null) { + oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); + struct.sessionHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRunReqTupleSchemeFactory implements SchemeFactory { + public TRunReqTupleScheme getScheme() { + return new TRunReqTupleScheme(); + } + } + + private static class TRunReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRunReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRunReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + +} + diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java index 3935555..4c06c1a 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java @@ -360,7 +360,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers str for (int _i1 = 0; _i1 < _map0.size; ++_i1) { String _key2; // required - TTypeQualifierValue _val3; // required + TTypeQualifierValue _val3; // optional _key2 = iprot.readString(); _val3 = new TTypeQualifierValue(); _val3.read(iprot); @@ -435,7 +435,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers stru for (int _i7 = 0; _i7 < _map6.size; ++_i7) { String _key8; // required - TTypeQualifierValue _val9; // required + TTypeQualifierValue _val9; // optional _key8 = iprot.readString(); _val9 = new TTypeQualifierValue(); _val9.read(iprot); diff --git service/src/gen/thrift/gen-php/TCLIService.php service/src/gen/thrift/gen-php/TCLIService.php index d246296..db44c99 100644 --- service/src/gen/thrift/gen-php/TCLIService.php +++ service/src/gen/thrift/gen-php/TCLIService.php @@ -20,6 +20,9 @@ interface TCLIServiceIf { public function CloseSession(\TCloseSessionReq $req); public function GetInfo(\TGetInfoReq $req); public function ExecuteStatement(\TExecuteStatementReq $req); + public function Compile(\TExecuteStatementReq $req); + public function Run(\TRunReq $req); + public function ExecuteTransient(\TExecuteStatementReq $req); public function GetTypeInfo(\TGetTypeInfoReq $req); public function GetCatalogs(\TGetCatalogsReq $req); public function GetSchemas(\TGetSchemasReq $req); @@ -252,6 +255,159 @@ class TCLIServiceClient implements \TCLIServiceIf { throw new \Exception("ExecuteStatement failed: unknown result"); } + public function Compile(\TExecuteStatementReq $req) + { + $this->send_Compile($req); + return $this->recv_Compile(); + } + + public function send_Compile(\TExecuteStatementReq $req) + { + $args = new \TCLIService_Compile_args(); + $args->req = $req; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'Compile', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('Compile', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_Compile() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\TCLIService_Compile_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 \TCLIService_Compile_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + throw new \Exception("Compile failed: unknown result"); + } + + public function Run(\TRunReq $req) + { + $this->send_Run($req); + return $this->recv_Run(); + } + + public function send_Run(\TRunReq $req) + { + $args = new \TCLIService_Run_args(); + $args->req = $req; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'Run', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('Run', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_Run() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\TCLIService_Run_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 \TCLIService_Run_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + throw new \Exception("Run failed: unknown result"); + } + + public function ExecuteTransient(\TExecuteStatementReq $req) + { + $this->send_ExecuteTransient($req); + return $this->recv_ExecuteTransient(); + } + + public function send_ExecuteTransient(\TExecuteStatementReq $req) + { + $args = new \TCLIService_ExecuteTransient_args(); + $args->req = $req; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'ExecuteTransient', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('ExecuteTransient', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_ExecuteTransient() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\TCLIService_ExecuteTransient_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 \TCLIService_ExecuteTransient_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + throw new \Exception("ExecuteTransient failed: unknown result"); + } + public function GetTypeInfo(\TGetTypeInfoReq $req) { $this->send_GetTypeInfo($req); @@ -1637,6 +1793,468 @@ class TCLIService_ExecuteStatement_result { } +class TCLIService_Compile_args { + static $_TSPEC; + + public $req = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'req', + 'type' => TType::STRUCT, + 'class' => '\TExecuteStatementReq', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['req'])) { + $this->req = $vals['req']; + } + } + } + + public function getName() { + return 'TCLIService_Compile_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::STRUCT) { + $this->req = new \TExecuteStatementReq(); + $xfer += $this->req->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('TCLIService_Compile_args'); + if ($this->req !== null) { + if (!is_object($this->req)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('req', TType::STRUCT, 1); + $xfer += $this->req->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_Compile_result { + static $_TSPEC; + + public $success = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\TCompileRes', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + } + } + + public function getName() { + return 'TCLIService_Compile_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::STRUCT) { + $this->success = new \TCompileRes(); + $xfer += $this->success->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('TCLIService_Compile_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_Run_args { + static $_TSPEC; + + public $req = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'req', + 'type' => TType::STRUCT, + 'class' => '\TRunReq', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['req'])) { + $this->req = $vals['req']; + } + } + } + + public function getName() { + return 'TCLIService_Run_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::STRUCT) { + $this->req = new \TRunReq(); + $xfer += $this->req->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('TCLIService_Run_args'); + if ($this->req !== null) { + if (!is_object($this->req)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('req', TType::STRUCT, 1); + $xfer += $this->req->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_Run_result { + static $_TSPEC; + + public $success = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\TStatus', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + } + } + + public function getName() { + return 'TCLIService_Run_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::STRUCT) { + $this->success = new \TStatus(); + $xfer += $this->success->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('TCLIService_Run_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_ExecuteTransient_args { + static $_TSPEC; + + public $req = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'req', + 'type' => TType::STRUCT, + 'class' => '\TExecuteStatementReq', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['req'])) { + $this->req = $vals['req']; + } + } + } + + public function getName() { + return 'TCLIService_ExecuteTransient_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::STRUCT) { + $this->req = new \TExecuteStatementReq(); + $xfer += $this->req->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('TCLIService_ExecuteTransient_args'); + if ($this->req !== null) { + if (!is_object($this->req)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('req', TType::STRUCT, 1); + $xfer += $this->req->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_ExecuteTransient_result { + static $_TSPEC; + + public $success = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\TStatus', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + } + } + + public function getName() { + return 'TCLIService_ExecuteTransient_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::STRUCT) { + $this->success = new \TStatus(); + $xfer += $this->success->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('TCLIService_ExecuteTransient_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class TCLIService_GetTypeInfo_args { static $_TSPEC; diff --git service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote old mode 100644 new mode 100755 index f6ff43f..0d8b248 --- service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote +++ service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote @@ -27,6 +27,9 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' TCloseSessionResp CloseSession(TCloseSessionReq req)' print ' TGetInfoResp GetInfo(TGetInfoReq req)' print ' TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req)' + print ' TCompileRes Compile(TExecuteStatementReq req)' + print ' TStatus Run(TRunReq req)' + print ' TStatus ExecuteTransient(TExecuteStatementReq req)' print ' TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req)' print ' TGetCatalogsResp GetCatalogs(TGetCatalogsReq req)' print ' TGetSchemasResp GetSchemas(TGetSchemasReq req)' @@ -117,6 +120,24 @@ elif cmd == 'ExecuteStatement': sys.exit(1) pp.pprint(client.ExecuteStatement(eval(args[0]),)) +elif cmd == 'Compile': + if len(args) != 1: + print 'Compile requires 1 args' + sys.exit(1) + pp.pprint(client.Compile(eval(args[0]),)) + +elif cmd == 'Run': + if len(args) != 1: + print 'Run requires 1 args' + sys.exit(1) + pp.pprint(client.Run(eval(args[0]),)) + +elif cmd == 'ExecuteTransient': + if len(args) != 1: + print 'ExecuteTransient requires 1 args' + sys.exit(1) + pp.pprint(client.ExecuteTransient(eval(args[0]),)) + elif cmd == 'GetTypeInfo': if len(args) != 1: print 'GetTypeInfo requires 1 args' diff --git service/src/gen/thrift/gen-py/TCLIService/TCLIService.py service/src/gen/thrift/gen-py/TCLIService/TCLIService.py index ebc6574..1d14269 100644 --- service/src/gen/thrift/gen-py/TCLIService/TCLIService.py +++ service/src/gen/thrift/gen-py/TCLIService/TCLIService.py @@ -46,6 +46,27 @@ def ExecuteStatement(self, req): """ pass + def Compile(self, req): + """ + Parameters: + - req + """ + pass + + def Run(self, req): + """ + Parameters: + - req + """ + pass + + def ExecuteTransient(self, req): + """ + Parameters: + - req + """ + pass + def GetTypeInfo(self, req): """ Parameters: @@ -279,6 +300,96 @@ def recv_ExecuteStatement(self, ): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); + def Compile(self, req): + """ + Parameters: + - req + """ + self.send_Compile(req) + return self.recv_Compile() + + def send_Compile(self, req): + self._oprot.writeMessageBegin('Compile', TMessageType.CALL, self._seqid) + args = Compile_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_Compile(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = Compile_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "Compile failed: unknown result"); + + def Run(self, req): + """ + Parameters: + - req + """ + self.send_Run(req) + return self.recv_Run() + + def send_Run(self, req): + self._oprot.writeMessageBegin('Run', TMessageType.CALL, self._seqid) + args = Run_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_Run(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = Run_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "Run failed: unknown result"); + + def ExecuteTransient(self, req): + """ + Parameters: + - req + """ + self.send_ExecuteTransient(req) + return self.recv_ExecuteTransient() + + def send_ExecuteTransient(self, req): + self._oprot.writeMessageBegin('ExecuteTransient', TMessageType.CALL, self._seqid) + args = ExecuteTransient_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_ExecuteTransient(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = ExecuteTransient_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "ExecuteTransient failed: unknown result"); + def GetTypeInfo(self, req): """ Parameters: @@ -738,6 +849,9 @@ def __init__(self, handler): self._processMap["CloseSession"] = Processor.process_CloseSession self._processMap["GetInfo"] = Processor.process_GetInfo self._processMap["ExecuteStatement"] = Processor.process_ExecuteStatement + self._processMap["Compile"] = Processor.process_Compile + self._processMap["Run"] = Processor.process_Run + self._processMap["ExecuteTransient"] = Processor.process_ExecuteTransient self._processMap["GetTypeInfo"] = Processor.process_GetTypeInfo self._processMap["GetCatalogs"] = Processor.process_GetCatalogs self._processMap["GetSchemas"] = Processor.process_GetSchemas @@ -813,6 +927,39 @@ def process_ExecuteStatement(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_Compile(self, seqid, iprot, oprot): + args = Compile_args() + args.read(iprot) + iprot.readMessageEnd() + result = Compile_result() + result.success = self._handler.Compile(args.req) + oprot.writeMessageBegin("Compile", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_Run(self, seqid, iprot, oprot): + args = Run_args() + args.read(iprot) + iprot.readMessageEnd() + result = Run_result() + result.success = self._handler.Run(args.req) + oprot.writeMessageBegin("Run", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_ExecuteTransient(self, seqid, iprot, oprot): + args = ExecuteTransient_args() + args.read(iprot) + iprot.readMessageEnd() + result = ExecuteTransient_result() + result.success = self._handler.ExecuteTransient(args.req) + oprot.writeMessageBegin("ExecuteTransient", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_GetTypeInfo(self, seqid, iprot, oprot): args = GetTypeInfo_args() args.read(iprot) @@ -1465,6 +1612,369 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +class Compile_args: + """ + Attributes: + - req + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', (TExecuteStatementReq, TExecuteStatementReq.thrift_spec), None, ), # 1 + ) + + def __init__(self, req=None,): + self.req = req + + 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.req = TExecuteStatementReq() + self.req.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('Compile_args') + if self.req is not None: + oprot.writeFieldBegin('req', TType.STRUCT, 1) + self.req.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 Compile_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TCompileRes, TCompileRes.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + 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.STRUCT: + self.success = TCompileRes() + self.success.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('Compile_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.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 Run_args: + """ + Attributes: + - req + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', (TRunReq, TRunReq.thrift_spec), None, ), # 1 + ) + + def __init__(self, req=None,): + self.req = req + + 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.req = TRunReq() + self.req.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('Run_args') + if self.req is not None: + oprot.writeFieldBegin('req', TType.STRUCT, 1) + self.req.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 Run_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TStatus, TStatus.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + 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.STRUCT: + self.success = TStatus() + self.success.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('Run_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.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 ExecuteTransient_args: + """ + Attributes: + - req + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', (TExecuteStatementReq, TExecuteStatementReq.thrift_spec), None, ), # 1 + ) + + def __init__(self, req=None,): + self.req = req + + 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.req = TExecuteStatementReq() + self.req.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('ExecuteTransient_args') + if self.req is not None: + oprot.writeFieldBegin('req', TType.STRUCT, 1) + self.req.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 ExecuteTransient_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TStatus, TStatus.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + 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.STRUCT: + self.success = TStatus() + self.success.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('ExecuteTransient_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.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 GetTypeInfo_args: """ Attributes: diff --git service/src/gen/thrift/gen-py/TCLIService/ttypes.py service/src/gen/thrift/gen-py/TCLIService/ttypes.py index 6cd64d0..ce2c947 100644 --- service/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ service/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -7,6 +7,8 @@ # from thrift.Thrift import TType, TMessageType, TException, TApplicationException +import queryplan.ttypes + from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol @@ -6382,3 +6384,172 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) + +class TCompileRes: + """ + Attributes: + - status + - operationHandle + - queryPlan + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'queryPlan', (queryplan.ttypes.Query, queryplan.ttypes.Query.thrift_spec), None, ), # 3 + ) + + def __init__(self, status=None, operationHandle=None, queryPlan=None,): + self.status = status + self.operationHandle = operationHandle + self.queryPlan = queryPlan + + 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.status = TStatus() + self.status.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.queryPlan = queryplan.ttypes.Query() + self.queryPlan.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('TCompileRes') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 2) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + if self.queryPlan is not None: + oprot.writeFieldBegin('queryPlan', TType.STRUCT, 3) + self.queryPlan.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocol.TProtocolException(message='Required field status is unset!') + if self.operationHandle is None: + raise TProtocol.TProtocolException(message='Required field operationHandle is unset!') + 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 TRunReq: + """ + Attributes: + - sessionHandle + - operationHandle + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2 + ) + + def __init__(self, sessionHandle=None, operationHandle=None,): + self.sessionHandle = sessionHandle + self.operationHandle = operationHandle + + 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.sessionHandle = TSessionHandle() + self.sessionHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.operationHandle = TOperationHandle() + self.operationHandle.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('TRunReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 2) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!') + if self.operationHandle is None: + raise TProtocol.TProtocolException(message='Required field operationHandle is unset!') + 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) diff --git service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote old mode 100644 new mode 100755 diff --git service/src/gen/thrift/gen-rb/t_c_l_i_service.rb service/src/gen/thrift/gen-rb/t_c_l_i_service.rb index fd1ca9a..d3fce6e 100644 --- service/src/gen/thrift/gen-rb/t_c_l_i_service.rb +++ service/src/gen/thrift/gen-rb/t_c_l_i_service.rb @@ -71,6 +71,51 @@ module TCLIService raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'ExecuteStatement failed: unknown result') end + def Compile(req) + send_Compile(req) + return recv_Compile() + end + + def send_Compile(req) + send_message('Compile', Compile_args, :req => req) + end + + def recv_Compile() + result = receive_message(Compile_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Compile failed: unknown result') + end + + def Run(req) + send_Run(req) + return recv_Run() + end + + def send_Run(req) + send_message('Run', Run_args, :req => req) + end + + def recv_Run() + result = receive_message(Run_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Run failed: unknown result') + end + + def ExecuteTransient(req) + send_ExecuteTransient(req) + return recv_ExecuteTransient() + end + + def send_ExecuteTransient(req) + send_message('ExecuteTransient', ExecuteTransient_args, :req => req) + end + + def recv_ExecuteTransient() + result = receive_message(ExecuteTransient_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'ExecuteTransient failed: unknown result') + end + def GetTypeInfo(req) send_GetTypeInfo(req) return recv_GetTypeInfo() @@ -329,6 +374,27 @@ module TCLIService write_result(result, oprot, 'ExecuteStatement', seqid) end + def process_Compile(seqid, iprot, oprot) + args = read_args(iprot, Compile_args) + result = Compile_result.new() + result.success = @handler.Compile(args.req) + write_result(result, oprot, 'Compile', seqid) + end + + def process_Run(seqid, iprot, oprot) + args = read_args(iprot, Run_args) + result = Run_result.new() + result.success = @handler.Run(args.req) + write_result(result, oprot, 'Run', seqid) + end + + def process_ExecuteTransient(seqid, iprot, oprot) + args = read_args(iprot, ExecuteTransient_args) + result = ExecuteTransient_result.new() + result.success = @handler.ExecuteTransient(args.req) + write_result(result, oprot, 'ExecuteTransient', seqid) + end + def process_GetTypeInfo(seqid, iprot, oprot) args = read_args(iprot, GetTypeInfo_args) result = GetTypeInfo_result.new() @@ -566,6 +632,102 @@ module TCLIService ::Thrift::Struct.generate_accessors self end + class Compile_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TExecuteStatementReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Compile_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCompileRes} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Run_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TRunReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Run_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ExecuteTransient_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TExecuteStatementReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ExecuteTransient_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class GetTypeInfo_args include ::Thrift::Struct, ::Thrift::Struct_Union REQ = 1 diff --git service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb index c731544..af65a7a 100644 --- service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb +++ service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb @@ -5,6 +5,8 @@ # require 'thrift' +require 'queryplan_types' + module TProtocolVersion HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 @@ -1758,3 +1760,45 @@ class TRenewDelegationTokenResp ::Thrift::Struct.generate_accessors self end +class TCompileRes + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + QUERYPLAN = 3 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}, + QUERYPLAN => {:type => ::Thrift::Types::STRUCT, :name => 'queryPlan', :class => ::Query, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TRunReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + diff --git service/src/java/org/apache/hive/service/CompileResult.java service/src/java/org/apache/hive/service/CompileResult.java new file mode 100644 index 0000000..47c8252 --- /dev/null +++ service/src/java/org/apache/hive/service/CompileResult.java @@ -0,0 +1,31 @@ +package org.apache.hive.service; + +import org.apache.hadoop.hive.ql.plan.api.Query; +import org.apache.hive.service.cli.thrift.TOperationHandle; + +public class CompileResult { + + private TOperationHandle handle; + private Query plan; + + public CompileResult(TOperationHandle handle, Query plan) { + this.handle = handle; + this.plan = plan; + } + + public TOperationHandle getHandle() { + return handle; + } + + public void setHandle(TOperationHandle handle) { + this.handle = handle; + } + + public Query getPlan() { + return plan; + } + + public void setPlan(Query plan) { + this.plan = plan; + } +} diff --git service/src/java/org/apache/hive/service/cli/CLIService.java service/src/java/org/apache/hive/service/cli/CLIService.java index 98cf6f8..574c8a6 100644 --- service/src/java/org/apache/hive/service/cli/CLIService.java +++ service/src/java/org/apache/hive/service/cli/CLIService.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hadoop.hive.shims.Utils; import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.CompositeService; import org.apache.hive.service.ServiceException; import org.apache.hive.service.auth.HiveAuthFactory; @@ -262,6 +263,29 @@ public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String return opHandle; } + @Override + public CompileResult compileStatement(SessionHandle sessionHandle, String statement, Map confOverlay) + throws HiveSQLException { + CompileResult result = sessionManager.getSession(sessionHandle) + .compileStatement(statement, confOverlay); + LOG.info(sessionHandle + ": compileStatement()"); + return result; + } + + @Override + public void runStatement(SessionHandle sessionHandle, OperationHandle opHandle) throws HiveSQLException { + sessionManager.getSession(sessionHandle) + .runStatement(opHandle); + LOG.info(sessionHandle + ": runStatement()"); + } + + @Override + public void executeTransient(SessionHandle sessionHandle, String statement, Map confOverlay) throws HiveSQLException { + sessionManager.getSession(sessionHandle) + .executeTransient(statement, confOverlay); + LOG.info(sessionHandle + ": executeTransient()"); + } + /* (non-Javadoc) * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) diff --git service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java index 9cad5be..3f24eb5 100644 --- service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java +++ service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; @@ -86,7 +87,32 @@ public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String Map confOverlay) throws HiveSQLException { return cliService.executeStatementAsync(sessionHandle, statement, confOverlay); } + +/* (non-Javadoc) + * @see org.apache.hive.service.cli.CLIServiceClient#getTypeInfo(org.apache.hive.service.cli.SessionHandle) + * @see org.apache.hive.service.sql.SQLServiceClient#compileStatement(org.apache.hive.service.sql.SessionHandle, java.lang.String, java.uti + */ + @Override + public CompileResult compileStatement(SessionHandle sessionHandle, String statement, Map confOverlay) + throws HiveSQLException { + return cliService.compileStatement(sessionHandle, statement, confOverlay); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.sql.SQLServiceClient#runStatement(org.apache.hive.service.sql.SessionHandle, org.apache.hive.service.sql.Se + */ + @Override + public void runStatement(SessionHandle sessionHandle, OperationHandle opHandle) throws HiveSQLException { + cliService.runStatement(sessionHandle, opHandle); + } + /* (non-Javadoc) + * @see org.apache.hive.service.sql.SQLServiceClient#executeTransient(org.apache.hive.service.sql.SessionHandle, java.lang.String, java.uti + */ + @Override + public void executeTransient(SessionHandle sessionHandle, String statement, Map confOverlay) throws HiveSQLException { + cliService.executeTransient(sessionHandle, statement, confOverlay); + } /* (non-Javadoc) * @see org.apache.hive.service.cli.CLIServiceClient#getTypeInfo(org.apache.hive.service.cli.SessionHandle) diff --git service/src/java/org/apache/hive/service/cli/ICLIService.java service/src/java/org/apache/hive/service/cli/ICLIService.java index c9cc1f4..beec2bb 100644 --- service/src/java/org/apache/hive/service/cli/ICLIService.java +++ service/src/java/org/apache/hive/service/cli/ICLIService.java @@ -21,8 +21,7 @@ import java.util.Map; - - +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; public interface ICLIService { @@ -48,6 +47,19 @@ OperationHandle executeStatement(SessionHandle sessionHandle, String statement, OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, Map confOverlay) throws HiveSQLException; + + public abstract CompileResult compileStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) + throws HiveSQLException; + + public abstract void runStatement(SessionHandle sessionHandle, + OperationHandle opHandle) + throws HiveSQLException; + + public abstract void executeTransient(SessionHandle sessionHandle, String statement, + Map confOverlay) + throws HiveSQLException; + OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException; diff --git service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java index 74d7d53..10dc5e9 100644 --- service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -19,7 +19,6 @@ package org.apache.hive.service.cli.operation; import java.io.IOException; -import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.security.PrivilegedExceptionAction; import java.sql.SQLException; @@ -35,11 +34,13 @@ import org.apache.hadoop.hive.metastore.api.Schema; import org.apache.hadoop.hive.ql.CommandNeedRetryException; import org.apache.hadoop.hive.ql.Driver; +import org.apache.hadoop.hive.ql.QueryPlan; import org.apache.hadoop.hive.ql.exec.ExplainTask; import org.apache.hadoop.hive.ql.exec.Task; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.parse.VariableSubstitution; +import org.apache.hadoop.hive.ql.plan.api.Query; import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; import org.apache.hadoop.hive.ql.session.SessionState; import org.apache.hadoop.hive.serde.serdeConstants; @@ -50,7 +51,6 @@ import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.StructField; import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hadoop.hive.shims.Utils; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.security.UserGroupInformation; @@ -76,10 +76,20 @@ private SerDe serde = null; private boolean fetchStarted = false; + private final HiveConf opConfig; + public SQLOperation(HiveSession parentSession, String statement, Map confOverlay, boolean runInBackground) { + String> confOverlay, boolean runInBackground) throws HiveSQLException { // TODO: call setRemoteUser in ExecuteStatementOperation or higher. super(parentSession, statement, confOverlay, runInBackground); + opConfig = getConfigForOperation(); + } + + @Override + public void runInternal() throws HiveSQLException { + setState(OperationState.PENDING); + prepare(); + executePlan(); } /*** @@ -87,27 +97,28 @@ public SQLOperation(HiveSession parentSession, String statement, Map task: driver.getPlan().getRootTasks()) { - if (task.getClass() == ExplainTask.class) { + for (Task task: plan.getRootTasks()) { + if (task instanceof ExplainTask) { resultSchema = new TableSchema(mResultSchema); setHasResultSet(true); break; } } + return plan; } catch (HiveSQLException e) { setState(OperationState.ERROR); throw e; } catch (Exception e) { setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); + throw new HiveSQLException("Error while compiling statement: " + statement + " by " + + e.toString(), e); } } - private void runQuery(HiveConf sqlOperationConf) throws HiveSQLException { + private void runQuery() throws HiveSQLException { try { // In Hive server mode, we are not able to retry in the FetchTask // case, when calling fetch queries since execute() has returned. // For now, we disable the test attempts. driver.setTryCount(Integer.MAX_VALUE); - response = driver.run(); + response = driver.executePlan(); if (0 != response.getResponseCode()) { throw toSQLException("Error while processing statement", response); } @@ -165,20 +178,16 @@ private void runQuery(HiveConf sqlOperationConf) throws HiveSQLException { setState(OperationState.FINISHED); } - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.PENDING); - final HiveConf opConfig = getConfigForOperation(); - prepare(opConfig); + private void executePlan() throws HiveSQLException { if (!shouldRunAsync()) { - runQuery(opConfig); + runQuery(); } else { // We'll pass ThreadLocals in the background thread from the foreground (handler) thread final SessionState parentSessionState = SessionState.get(); // ThreadLocal Hive object needs to be set in background thread. // The metastore client in Hive is associated with right user. final Hive parentHive = getSessionHive(); - // Current UGI will get used by metastore when metsatore is in embedded mode + // Current UGI will get used by metastore when metastore is in embedded mode // So this needs to get passed to the new background thread final UserGroupInformation currentUGI = getCurrentUGI(opConfig); // Runnable impl to call runInternal asynchronously, @@ -194,7 +203,7 @@ public Object run() throws HiveSQLException { // Set current OperationLog in this async thread for keeping on saving query log. registerCurrentOperationLog(); try { - runQuery(opConfig); + runQuery(); } catch (HiveSQLException e) { setOperationException(e); LOG.error("Error running hive query: ", e); @@ -310,7 +319,6 @@ public void close() throws HiveSQLException { @Override public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); if (resultSchema == null) { resultSchema = new TableSchema(driver.getSchema()); } @@ -447,7 +455,7 @@ private SerDe getSerDe() throws SQLException { private HiveConf getConfigForOperation() throws HiveSQLException { HiveConf sqlOperationConf = getParentSession().getHiveConf(); if (!getConfOverlay().isEmpty() || shouldRunAsync()) { - // clone the partent session config for this query + // clone the parent session config for this query sqlOperationConf = new HiveConf(sqlOperationConf); // apply overlay query specific settings, if any @@ -461,4 +469,22 @@ private HiveConf getConfigForOperation() throws HiveSQLException { } return sqlOperationConf; } + + public Query compile() throws HiveSQLException { + if (driver != null) { + throw new HiveSQLException("Query is already in compiled state"); + } + return prepare().getQueryPlan(); + } + + public void runPlan() throws HiveSQLException { + if (driver == null) { + throw new HiveSQLException("Query is not in compiled state"); + } + executePlan(); + } + + public QueryPlan getPlan() { + return driver.getPlan(); + } } diff --git service/src/java/org/apache/hive/service/cli/session/HiveSession.java service/src/java/org/apache/hive/service/cli/session/HiveSession.java index 6359a5b..e9442e0 100644 --- service/src/java/org/apache/hive/service/cli/session/HiveSession.java +++ service/src/java/org/apache/hive/service/cli/session/HiveSession.java @@ -22,6 +22,7 @@ import java.util.Map; import org.apache.hadoop.hive.metastore.IMetaStoreClient; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; import org.apache.hive.service.cli.*; @@ -59,6 +60,14 @@ OperationHandle executeStatement(String statement, OperationHandle executeStatementAsync(String statement, Map confOverlay) throws HiveSQLException; + public CompileResult compileStatement(String statement, Map confOverlay) + throws HiveSQLException; + + public void runStatement(OperationHandle opHandle) throws HiveSQLException; + + public void executeTransient(String statement, Map confOverlay) + throws HiveSQLException; + /** * getTypeInfo operation handler * @return diff --git service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java index cabf32a..673ce7d 100644 --- service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java +++ service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java @@ -43,9 +43,11 @@ import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.processors.SetProcessor; +import org.apache.hadoop.hive.ql.plan.api.Query; import org.apache.hadoop.hive.ql.session.SessionState; import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hive.common.util.HiveVersionInfo; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; import org.apache.hive.service.cli.*; import org.apache.hive.service.cli.operation.ExecuteStatementOperation; @@ -58,6 +60,7 @@ import org.apache.hive.service.cli.operation.MetadataOperation; import org.apache.hive.service.cli.operation.Operation; import org.apache.hive.service.cli.operation.OperationManager; +import org.apache.hive.service.cli.operation.SQLOperation; import org.apache.hive.service.cli.thrift.TProtocolVersion; import org.apache.hive.service.server.ThreadWithGarbageCleanup; @@ -153,11 +156,8 @@ public void initialize(Map sessionConfMap) throws Exception { private class GlobalHivercFileProcessor extends HiveFileProcessor { @Override protected BufferedReader loadFile(String fileName) throws IOException { - FileInputStream initStream = null; - BufferedReader bufferedReader = null; - initStream = new FileInputStream(fileName); - bufferedReader = new BufferedReader(new InputStreamReader(initStream)); - return bufferedReader; + FileInputStream initStream = new FileInputStream(fileName); + return new BufferedReader(new InputStreamReader(initStream)); } @Override @@ -401,6 +401,59 @@ private OperationHandle executeStatementInternal(String statement, Map confOverlay) + throws HiveSQLException { + acquire(true); + try { + OperationManager manager = getOperationManager(); + ExecuteStatementOperation operation = manager + .newExecuteStatementOperation(this, statement, confOverlay, false); + Query queryPlan = null; + if (operation instanceof SQLOperation) { + queryPlan = ((SQLOperation)operation).compile(); + } else { + operation.run(); + } + return new CompileResult(operation.getHandle().toTOperationHandle(), queryPlan); + } finally { + release(true); + } + } + + @Override + public void runStatement(OperationHandle opHandle) throws HiveSQLException { + acquire(true); + try { + Operation operation = getOperationManager().getOperation(opHandle); + if (operation instanceof SQLOperation) { + ((SQLOperation)operation).runPlan(); + } + } finally { + release(true); + } + } + + @Override + public void executeTransient(String statement, Map confOverlay) + throws HiveSQLException { + acquire(true); + try { + ExecuteStatementOperation operation = getOperationManager() + .newExecuteStatementOperation(this, statement, confOverlay, false); + try { + if (operation instanceof SQLOperation) { + throw new HiveSQLException("Query is not allowed in executeTransient()"); + } + operation.run(); + } finally { + getOperationManager().closeOperation(operation.getHandle()); + } + } finally { + release(true); + } + } + + @Override public OperationHandle getTypeInfo() throws HiveSQLException { acquire(true); diff --git service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 3345b5f..b695466 100644 --- service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -34,6 +34,7 @@ import org.apache.hive.service.AbstractService; import org.apache.hive.service.ServiceException; import org.apache.hive.service.ServiceUtils; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; import org.apache.hive.service.auth.TSetIpAddressProcessor; import org.apache.hive.service.cli.*; @@ -425,6 +426,52 @@ public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws T } @Override + public TCompileRes Compile(TExecuteStatementReq req) throws TException { + TCompileRes resp = new TCompileRes(); + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + String statement = req.getStatement(); + Map confOverlay = req.getConfOverlay(); + CompileResult result = + cliService.compileStatement(sessionHandle, statement, confOverlay); + resp.setOperationHandle(result.getHandle()); + resp.setQueryPlan(result.getPlan()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + e.printStackTrace(); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TStatus Run(TRunReq req) throws TException { + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + OperationHandle operationHandle = new OperationHandle(req.getOperationHandle()); + cliService.runStatement(sessionHandle, operationHandle); + return OK_STATUS; + } catch (Exception e) { + e.printStackTrace(); + return HiveSQLException.toTStatus(e); + } + } + + @Override + public TStatus ExecuteTransient(TExecuteStatementReq req) throws TException { + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + String statement = req.getStatement(); + Map confOverlay = req.getConfOverlay(); + cliService.executeTransient(sessionHandle, statement, confOverlay); + return OK_STATUS; + } catch (Exception e) { + e.printStackTrace(); + return HiveSQLException.toTStatus(e); + } + } + + @Override public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { TGetTypeInfoResp resp = new TGetTypeInfoResp(); try { diff --git service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java index 1af4539..1536fe9 100644 --- service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java +++ service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; +import org.apache.hive.service.CompileResult; import org.apache.hive.service.auth.HiveAuthFactory; import org.apache.hive.service.cli.*; import org.apache.thrift.TException; @@ -147,6 +148,55 @@ private OperationHandle executeStatementInternal(SessionHandle sessionHandle, St } } + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) + * @see org.apache.hive.service.sql.SQLServiceClient#compileStatement(org.apache.hive.service.sql.SessionHandle, java.lang.String, java.uti + */ + @Override + public CompileResult compileStatement(SessionHandle sessionHandle, String statement, Map confOverlay) + throws HiveSQLException { + try { + TExecuteStatementReq req = new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); + req.setConfOverlay(confOverlay); + TCompileRes resp = cliService.Compile(req); + checkStatus(resp.getStatus()); + return new CompileResult(resp.getOperationHandle(), resp.getQueryPlan()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.sql.SQLServiceClient#runStatement(org.apache.hive.service.sql.SessionHandle, org.apache.hive.service.sql.Se + */ + @Override + public void runStatement(SessionHandle sessionHandle, OperationHandle opHandle) throws HiveSQLException { + try { + TRunReq req = new TRunReq(sessionHandle.toTSessionHandle(), opHandle.toTOperationHandle()); + checkStatus(cliService.Run(req)); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.sql.SQLServiceClient#executeTransient(org.apache.hive.service.sql.SessionHandle, java.lang.String, java.uti + */ + @Override + public void executeTransient(SessionHandle sessionHandle, String statement, Map confOverlay) throws HiveSQLException { + try { + TExecuteStatementReq req = new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); + req.setConfOverlay(confOverlay); + checkStatus(cliService.ExecuteTransient(req)); + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + /* (non-Javadoc) * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) */