You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2016/01/08 01:19:58 UTC
[48/51] [partial] hive git commit: HIVE-12442: Refactor/repackage
HiveServer2's Thrift code so that it can be used in the tasks (Rohit Dholakia
reviewed by Vaibhav Gumashta)
http://git-wip-us.apache.org/repos/asf/hive/blob/2542f5cc/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp
new file mode 100644
index 0000000..a86fca8
--- /dev/null
+++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.cpp
@@ -0,0 +1,72 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.2)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include "TCLIService_constants.h"
+
+namespace apache { namespace hive { namespace service { namespace rpc { namespace thrift {
+
+const TCLIServiceConstants g_TCLIService_constants;
+
+TCLIServiceConstants::TCLIServiceConstants() {
+ PRIMITIVE_TYPES.insert((TTypeId::type)0);
+ PRIMITIVE_TYPES.insert((TTypeId::type)1);
+ PRIMITIVE_TYPES.insert((TTypeId::type)2);
+ PRIMITIVE_TYPES.insert((TTypeId::type)3);
+ PRIMITIVE_TYPES.insert((TTypeId::type)4);
+ PRIMITIVE_TYPES.insert((TTypeId::type)5);
+ PRIMITIVE_TYPES.insert((TTypeId::type)6);
+ PRIMITIVE_TYPES.insert((TTypeId::type)7);
+ PRIMITIVE_TYPES.insert((TTypeId::type)8);
+ PRIMITIVE_TYPES.insert((TTypeId::type)9);
+ PRIMITIVE_TYPES.insert((TTypeId::type)15);
+ PRIMITIVE_TYPES.insert((TTypeId::type)16);
+ PRIMITIVE_TYPES.insert((TTypeId::type)17);
+ PRIMITIVE_TYPES.insert((TTypeId::type)18);
+ PRIMITIVE_TYPES.insert((TTypeId::type)19);
+ PRIMITIVE_TYPES.insert((TTypeId::type)20);
+ PRIMITIVE_TYPES.insert((TTypeId::type)21);
+
+ COMPLEX_TYPES.insert((TTypeId::type)10);
+ COMPLEX_TYPES.insert((TTypeId::type)11);
+ COMPLEX_TYPES.insert((TTypeId::type)12);
+ COMPLEX_TYPES.insert((TTypeId::type)13);
+ COMPLEX_TYPES.insert((TTypeId::type)14);
+
+ COLLECTION_TYPES.insert((TTypeId::type)10);
+ COLLECTION_TYPES.insert((TTypeId::type)11);
+
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)0, "BOOLEAN"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)1, "TINYINT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)2, "SMALLINT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)3, "INT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)4, "BIGINT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)5, "FLOAT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)6, "DOUBLE"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)7, "STRING"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)8, "TIMESTAMP"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)9, "BINARY"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)10, "ARRAY"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)11, "MAP"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)12, "STRUCT"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)13, "UNIONTYPE"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)15, "DECIMAL"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)16, "NULL"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)17, "DATE"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)18, "VARCHAR"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)19, "CHAR"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)20, "INTERVAL_YEAR_MONTH"));
+ TYPE_NAMES.insert(std::make_pair((TTypeId::type)21, "INTERVAL_DAY_TIME"));
+
+ CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength";
+
+ PRECISION = "precision";
+
+ SCALE = "scale";
+
+}
+
+}}}}} // namespace
+
http://git-wip-us.apache.org/repos/asf/hive/blob/2542f5cc/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.h
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.h b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.h
new file mode 100644
index 0000000..8411ae8
--- /dev/null
+++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_constants.h
@@ -0,0 +1,31 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.2)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef TCLIService_CONSTANTS_H
+#define TCLIService_CONSTANTS_H
+
+#include "TCLIService_types.h"
+
+namespace apache { namespace hive { namespace service { namespace rpc { namespace thrift {
+
+class TCLIServiceConstants {
+ public:
+ TCLIServiceConstants();
+
+ std::set<TTypeId::type> PRIMITIVE_TYPES;
+ std::set<TTypeId::type> COMPLEX_TYPES;
+ std::set<TTypeId::type> COLLECTION_TYPES;
+ std::map<TTypeId::type, std::string> TYPE_NAMES;
+ std::string CHARACTER_MAXIMUM_LENGTH;
+ std::string PRECISION;
+ std::string SCALE;
+};
+
+extern const TCLIServiceConstants g_TCLIService_constants;
+
+}}}}} // namespace
+
+#endif
http://git-wip-us.apache.org/repos/asf/hive/blob/2542f5cc/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
new file mode 100644
index 0000000..66ed6a7
--- /dev/null
+++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
@@ -0,0 +1,134 @@
+// This autogenerated skeleton file illustrates how to build a server.
+// You should copy it to another filename to avoid overwriting it.
+
+#include "TCLIService.h"
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+using boost::shared_ptr;
+
+using namespace ::apache::hive::service::rpc::thrift;
+
+class TCLIServiceHandler : virtual public TCLIServiceIf {
+ public:
+ TCLIServiceHandler() {
+ // Your initialization goes here
+ }
+
+ void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) {
+ // Your implementation goes here
+ printf("OpenSession\n");
+ }
+
+ void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) {
+ // Your implementation goes here
+ printf("CloseSession\n");
+ }
+
+ void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) {
+ // Your implementation goes here
+ printf("GetInfo\n");
+ }
+
+ void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) {
+ // Your implementation goes here
+ printf("ExecuteStatement\n");
+ }
+
+ void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) {
+ // Your implementation goes here
+ printf("GetTypeInfo\n");
+ }
+
+ void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) {
+ // Your implementation goes here
+ printf("GetCatalogs\n");
+ }
+
+ void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) {
+ // Your implementation goes here
+ printf("GetSchemas\n");
+ }
+
+ void GetTables(TGetTablesResp& _return, const TGetTablesReq& req) {
+ // Your implementation goes here
+ printf("GetTables\n");
+ }
+
+ void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) {
+ // Your implementation goes here
+ printf("GetTableTypes\n");
+ }
+
+ void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) {
+ // Your implementation goes here
+ printf("GetColumns\n");
+ }
+
+ void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) {
+ // Your implementation goes here
+ printf("GetFunctions\n");
+ }
+
+ void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) {
+ // Your implementation goes here
+ printf("GetOperationStatus\n");
+ }
+
+ void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) {
+ // Your implementation goes here
+ printf("CancelOperation\n");
+ }
+
+ void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) {
+ // Your implementation goes here
+ printf("CloseOperation\n");
+ }
+
+ void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) {
+ // Your implementation goes here
+ printf("GetResultSetMetadata\n");
+ }
+
+ void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) {
+ // Your implementation goes here
+ printf("FetchResults\n");
+ }
+
+ void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) {
+ // Your implementation goes here
+ printf("GetDelegationToken\n");
+ }
+
+ void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) {
+ // Your implementation goes here
+ printf("CancelDelegationToken\n");
+ }
+
+ void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) {
+ // Your implementation goes here
+ printf("RenewDelegationToken\n");
+ }
+
+};
+
+int main(int argc, char **argv) {
+ int port = 9090;
+ shared_ptr<TCLIServiceHandler> handler(new TCLIServiceHandler());
+ shared_ptr<TProcessor> processor(new TCLIServiceProcessor(handler));
+ shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
+ shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+ shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+
+ TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
+ server.serve();
+ return 0;
+}
+